From a1afeef0c41f93f594290b01da2950b32701a7bc Mon Sep 17 00:00:00 2001 From: keen99 Date: Tue, 8 Jul 2014 16:01:58 -0400 Subject: [PATCH] make _create_or_patch_scmbrc noclobber safe use >| instead of > to override noclobber on write (works for both bash and zsh) --- lib/scm_breeze.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/scm_breeze.sh b/lib/scm_breeze.sh index 7d84148..59e4548 100644 --- a/lib/scm_breeze.sh +++ b/lib/scm_breeze.sh @@ -48,7 +48,7 @@ _create_or_patch_scmbrc() { # If file exists, attempt to update it with any new settings elif [ -n "$1" ]; then # Create diff of example file, substituting example file for user's config. - git diff $1 "$prefix""scmbrc.example" | sed "s/$prefix""scmbrc.example/.$prefix""scmbrc/g" > $patchfile + git diff $1 "$prefix""scmbrc.example" | sed "s/$prefix""scmbrc.example/.$prefix""scmbrc/g" >| $patchfile if [ -s $patchfile ]; then # If patchfile is not empty cd "$HOME" # If the patch cannot be applied cleanly, show the updates and tell user to update file manually.