]> git.phdru.name Git - cookiecutter.git/commitdiff
Fix: Add remote `current` or set path if it exists master
authorOleg Broytman <phd@phdru.name>
Mon, 9 Dec 2024 16:50:34 +0000 (19:50 +0300)
committerOleg Broytman <phd@phdru.name>
Mon, 9 Dec 2024 16:50:34 +0000 (19:50 +0300)
clone2current
publish2web

index 737ccbfc1a77e1e33aef150b166a9bd532535720..9ec08df527efc88a011f59bcc09e85a34f86d2a6 100755 (executable)
@@ -39,4 +39,7 @@ cd "$source_dir" &&
 if [ -n "$directories" ]; then
    dest_dir="$directories/$dest_dir"
 fi &&
-exec git remote add current "$HOME"/current/projects/"$dest_dir"
+{
+    git remote add current "$HOME"/current/projects/"$dest_dir" ||
+    exec git remote set-url current "$HOME"/current/projects/"$dest_dir"
+}
index b0898f1fece84e3871872e0376a4f5d9cd1b5658..933227c597f40bc62fbd3ed5bf75fc5b53166218 100755 (executable)
@@ -52,5 +52,8 @@ cd "$source_dir" &&
 if [ -n "$directories" ]; then
    dest_dir="$directories/$dest_dir"
 fi &&
-git remote add web "$HOME"/Internet/WWW/htdocs/git.phdru.name/"$dest_dir" &&
+{
+    git remote add web "$HOME"/Internet/WWW/htdocs/git.phdru.name/"$dest_dir" ||
+    git remote set-url web "$HOME"/Internet/WWW/htdocs/git.phdru.name/"$dest_dir"
+} &&
 exec git push --set-upstream web master