aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/.bashrc_git
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2016-08-14 11:42:56 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2016-08-14 11:42:56 +0200
commit3b713427c07f042852c826efb0010e4bb3404b0c (patch)
tree664918bc4a11cab4f5ac9894e7b16a083f03e2a2 /.bashrc_git
parentexport PYTHONSTARTUP (diff)
downloadlinux-home-3b713427c07f042852c826efb0010e4bb3404b0c.tar.gz
linux-home-3b713427c07f042852c826efb0010e4bb3404b0c.zip
set -o errexit -o nounset -o pipefail in functions
Diffstat (limited to '')
-rw-r--r--.bashrc_git16
1 files changed, 9 insertions, 7 deletions
diff --git a/.bashrc_git b/.bashrc_git
index e5eaf3f..5b930a1 100644
--- a/.bashrc_git
+++ b/.bashrc_git
@@ -7,6 +7,8 @@ else
fi
list_repo_files() (
+ set -o errexit -o nounset -o pipefail
+
local -a cmd=(git ls-files)
while [ "$#" -gt 0 ]; do
@@ -32,8 +34,7 @@ list_repo_files() (
)
list_repo_dirs() (
- set -o errexit
- set -o pipefail
+ set -o errexit -o nounset -o pipefail
local terminator='\n'
@@ -64,8 +65,7 @@ list_repo_dirs() (
)
tighten_repo_security() (
- set -o errexit
- set -o pipefail
+ set -o errexit -o nounset -o pipefail
list_repo_files -z | xargs -0 chmod 0600
list_repo_dirs -z | xargs -0 chmod 0700
@@ -73,7 +73,7 @@ tighten_repo_security() (
)
backup_repo() (
- set -o errexit
+ set -o errexit -o nounset -o pipefail
local repo_dir
repo_dir="$( realpath . )"
@@ -98,6 +98,8 @@ backup_repo() (
HEAD
)
-backup_repo_dropbox() {
+backup_repo_dropbox() (
+ set -o errexit -o nounset -o pipefail
+
backup_repo "$USERPROFILE/Dropbox/backups"
-}
+)