comparison moefetch.sh @ 185:6d926d4b3c5a

initial clean system support
author edhoprima@gmail.com <edhoprima@gmail.com>
date Sun, 28 Jun 2009 13:10:28 +0000
parents d94e789fd092
children 197266fefbb4
comparison
equal deleted inserted replaced
184:d94e789fd092 185:6d926d4b3c5a
247 Err_Help 247 Err_Help
248 ;; 248 ;;
249 esac 249 esac
250 shift 250 shift
251 SITE= 251 SITE=
252 case "$1" in 252 TAGS=
253 -s|--site) 253 while [ "${1}" ]; do
254 shift 254 case "$1" in
255 SITE="$1" 255 -s|--site)
256 shift 256 shift
257 ;; 257 SITE="$1"
258 *) 258 ;;
259 SITE="${DEFAULT_SITE}" 259 -nc|--noclean)
260 ;; 260 NOCLEAN=1
261 esac 261 ;;
262 *)
263 TAGS="$1 ${TAGS}"
264 ;;
265 esac
266 shift
267 done
268 [ "${SITE}" ] || SITE="${DEFAULT_SITE}"
269 [ "${TAGS}" ] || Err_Fatal "No tag specified"
262 # Get base folder - default, current folder or fallback to ${HOME} 270 # Get base folder - default, current folder or fallback to ${HOME}
263 [ "${BASE_DIR}" ] || BASE_DIR="${PWD}" 271 [ "${BASE_DIR}" ] || BASE_DIR="${PWD}"
264 [ "${BASE_DIR}" ] || BASE_DIR="{$HOME}" 272 [ "${BASE_DIR}" ] || BASE_DIR="{$HOME}"
265 [ "`echo ${BASE_DIR} | cut -c1 | grep \/`" ] || BASE_DIR="/${BASE_DIR}" 273 [ "`echo ${BASE_DIR} | cut -c1 | grep \/`" ] || BASE_DIR="/${BASE_DIR}"
266 274
267 TAGS="$@"
268 echo "Tags: ${TAGS}" 275 echo "Tags: ${TAGS}"
269 # slash is not wanted for folder name 276 # slash is not wanted for folder name
270 TARGET_DIR="`echo "${TAGS}" | sed -e 's/\//_/g'`" 277 TARGET_DIR="`echo "${TAGS}" | sed -e 's/\//_/g'`"
271 SITE_DIR="`echo "${SITE}" | sed -e 's/\/$//g;s/\//_/g'`" 278 SITE_DIR="`echo "${SITE}" | sed -e 's/\/$//g;s/\//_/g'`"
272 } 279 }