diff --git a/backup.sh b/backup.sh index aadc6fc..6bb6665 100755 --- a/backup.sh +++ b/backup.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash +set -e GIT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) rm -rf $GIT_DIR/fish diff --git a/commit.sh b/commit.sh index 2f43f85..b21c6bf 100755 --- a/commit.sh +++ b/commit.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash +set -e GIT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) cd $GIT_DIR git add . diff --git a/create-cron-job.sh b/create-cron-job.sh new file mode 100755 index 0000000..06dc556 --- /dev/null +++ b/create-cron-job.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -e +GIT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) + +(crontab -l 2>/dev/null; echo "0 * * * * $GIT_DIR/commit.sh") | crontab - \ No newline at end of file diff --git a/restore.sh b/restore.sh index 1ab2d4c..1a72bf5 100644 --- a/restore.sh +++ b/restore.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash +set -e GIT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) rm -rf $HOME/.config/fish/