Browse Source

update start

Gabriel Capella 1 year ago
parent
commit
48fb206a3d
1 changed files with 3 additions and 6 deletions
  1. 3 6
      start

+ 3 - 6
start

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