|
|
@ -40,8 +40,17 @@ elif [ "$1" == "list" ]; then |
|
|
|
|
|
|
|
|
|
|
|
elif [ "$1" == "get" ] && [ "$2" != "" ]; then |
|
|
|
elif [ "$1" == "get" ] && [ "$2" != "" ]; then |
|
|
|
FILE=$(readlink -f $2) |
|
|
|
FILE=$(readlink -f $2) |
|
|
|
|
|
|
|
FILE_CUT_HOME="$(echo $FILE | sed -nr 's/^\/home\/'$USER'\/(.*)$/\1/p')" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# /home/<user>/ |
|
|
|
|
|
|
|
if [ -n "$FILE_CUT_HOME" ]; then |
|
|
|
|
|
|
|
mkdir -p $(pwd)/$(dirname $FILE_CUT_HOME) |
|
|
|
|
|
|
|
cp $FILE $(pwd)/$FILE_CUT_HOME |
|
|
|
|
|
|
|
# / |
|
|
|
|
|
|
|
else |
|
|
|
mkdir -p $(pwd)/$(dirname $FILE) |
|
|
|
mkdir -p $(pwd)/$(dirname $FILE) |
|
|
|
cp $FILE $(pwd)/$FILE |
|
|
|
cp $FILE $(pwd)/$FILE |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
elif [ "$1" == "pull" ] || [ "$1" == "push" ]; then |
|
|
|
elif [ "$1" == "pull" ] || [ "$1" == "push" ]; then |
|
|
|
for f in $FILES; do |
|
|
|
for f in $FILES; do |
|
|
|