add GIS_PATH variable
This commit is contained in:
parent
fe21879476
commit
a1927ee61b
1 changed files with 8 additions and 3 deletions
11
gis
11
gis
|
|
@ -12,7 +12,8 @@ function print_usage {
|
|||
Usage: gis [OPTIONS] [PATHS] ...
|
||||
|
||||
Get status information about all Git repositories in PATHS.
|
||||
The current work directory is used if none is given.
|
||||
The colon-seperated environment variable \$GIS_PATH is used if no PATH is given.
|
||||
If the variable isn't set, the current work directory is used.
|
||||
|
||||
OPTIONS
|
||||
-f, --fetch Execute 'git fetch --prune --all' for all repositories in PATHS
|
||||
|
|
@ -43,8 +44,12 @@ while (( "$#" )); do
|
|||
esac
|
||||
done
|
||||
|
||||
# Add current work directory to paths if none is given
|
||||
if [ "${paths[*]}" == "" ]; then
|
||||
# Add $GIS_PATH or current work directory to paths if none is given
|
||||
if [ "$GIS_PATH" ]; then
|
||||
OLDIFS=$IFS
|
||||
IFS=":" read -r -a paths <<< "$GIS_PATH"
|
||||
IFS=$OLDIFS
|
||||
elif [ "${paths[*]}" == "" ]; then
|
||||
paths=("$(pwd)")
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue