Files
Ali Abbas c1ec392bdd - Double quoting to avoid globbing
- Remove unecessary $(cat)
- switch * to ./* to avoid entries with dashes to be treated as options
- replace $* with "$@"
- repeating change path serial calls - unecessary if change path is called one (get script)
2014-04-12 15:56:54 +02:00

31 lines
704 B
Bash
Executable File

#!/usr/bin/env bash
. "$GVM_ROOT/scripts/functions"
version=$1
if [ "$version" != "" ]; then
fuzzy_match=$($LS_PATH "$GVM_ROOT/gos" | $SORT_PATH | $GREP_PATH "$version" | $HEAD_PATH -n 1 | $GREP_PATH "$version") ||
display_fatal "Invalid version $version"
foldername=$GVM_ROOT/gos/$fuzzy_match
else
if [[ "$gvm_go_name" != "" ]]; then
foldername=$GVM_ROOT/gos/$gvm_go_name
else
display_fatal "No version selected"
fi
fi
if [[ -d $foldername ]]; then
cd "$foldername"
find . > /tmp/manifest.test
diff manifest /tmp/manifest.test
if [[ "$?" == "0" ]]; then
display_message "Clean $foldername"
else
display_message "*Dirty* $foldername"
fi
else
display_fatal "Invalid version"
fi