|
@@ -29,12 +29,7 @@ sub_sync(){
|
|
git pull
|
|
git pull
|
|
if [ ! -z "$1" ]; then
|
|
if [ ! -z "$1" ]; then
|
|
real_path=$(realpath $1)
|
|
real_path=$(realpath $1)
|
|
- if [[ ! -d $real_path ]]; then
|
|
|
|
- echo "$real_path is not a dir!"
|
|
|
|
- exit 0
|
|
|
|
- fi
|
|
|
|
to_copy=${real_path#*$HOME}
|
|
to_copy=${real_path#*$HOME}
|
|
- mkdir -p $(pwd)$to_copy
|
|
|
|
cp -R $real_path $(pwd)$to_copy
|
|
cp -R $real_path $(pwd)$to_copy
|
|
rm -rf $real_path
|
|
rm -rf $real_path
|
|
echo "${to_copy/\//}" >> ../to_sync
|
|
echo "${to_copy/\//}" >> ../to_sync
|
|
@@ -42,7 +37,8 @@ sub_sync(){
|
|
cd ..
|
|
cd ..
|
|
git add .
|
|
git add .
|
|
if git commit -am "$(date)"; then
|
|
if git commit -am "$(date)"; then
|
|
- git push
|
|
|
|
|
|
+ git remote add origin $repo || true
|
|
|
|
+ git push -u origin master
|
|
fi
|
|
fi
|
|
|
|
|
|
while read p; do
|
|
while read p; do
|