diff --git a/README.md b/README.md index bda72314..5ad4fa30 100644 --- a/README.md +++ b/README.md @@ -2035,15 +2035,14 @@ reset github as if it's newly born. ALL history will be lost. #!/bin/bash #Maintained in linux-init-files.org tfile=$(mktemp /tmp/config.XXXXXXXXX) -GITCONF=".git/config" -commitmsg=${1:-git repository initialised} -if [ -f $GITCONF ]; then - mv .git/config tfile +commitmsg=${1:-"git repository initialised"} +if [ -f .git/config ]; then + mv .git/config "$tfile" rm -rf .git git init . - mv tfile .git/config + mv "$tfile" .git/config git add . - git commit -a -m "${commitmsg}" + git commit -a -m "$commitmsg" git push -f else echo "Warning: No git config file found. Aborting.";exit; diff --git a/directories/bin/resgithub b/directories/bin/resgithub index 649eb6e0..6dfd2ddb 100755 --- a/directories/bin/resgithub +++ b/directories/bin/resgithub @@ -3,11 +3,11 @@ tfile=$(mktemp /tmp/config.XXXXXXXXX) GITCONF=".git/config" commitmsg=${1:-git repository initialised} -if [ -f $GITCONF ]; then - mv .git/config tfile +if [ -f "$GITCONF" ]; then + mv "$GITCONF" tfile rm -rf .git git init . - mv tfile .git/config + mv tfile "$GITCONF" git add . git commit -a -m "${commitmsg}" git push -f diff --git a/linux-init-files.org b/linux-init-files.org index 4d0387f8..a83d0e26 100644 --- a/linux-init-files.org +++ b/linux-init-files.org @@ -1899,15 +1899,14 @@ #!/bin/bash #Maintained in linux-init-files.org tfile=$(mktemp /tmp/config.XXXXXXXXX) - GITCONF=".git/config" - commitmsg=${1:-git repository initialised} - if [ -f $GITCONF ]; then - mv .git/config tfile + commitmsg=${1:-"git repository initialised"} + if [ -f .git/config ]; then + mv .git/config "$tfile" rm -rf .git git init . - mv tfile .git/config + mv "$tfile" .git/config git add . - git commit -a -m "${commitmsg}" + git commit -a -m "$commitmsg" git push -f else echo "Warning: No git config file found. Aborting.";exit;