From: Gustav Eek Date: Sun, 28 Jun 2015 18:47:01 +0000 (+0200) Subject: [repo-encrypt] Updated for Mac X-Git-Url: https://git.g-eek.se/?a=commitdiff_plain;h=3473de8f49e5c29a059033e37d5efd60e83d91fa;p=users%2Fgustav%2Fscripts.git [repo-encrypt] Updated for Mac The Mac version of the *cp* command can not handle . The flag is a replacement. --- diff --git a/Makefile b/Makefile index db29e8d..8fc6a36 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ # terms of the GNU General Public License SHELL = /bin/bash -INSTALL = ~/bin +INSTALL = $(HOME)/bin scripts = \ msmtp-notify \ @@ -11,7 +11,7 @@ repo-encrypt \ bash-completion = \ repo-encrypt \ -dir := $(abspath $(wildcard $(INSTALL))) +dir := $(INSTALL) dir-completion := $(dir)/bash_completion.d default: help diff --git a/repo-encrypt b/repo-encrypt index 1e59c71..6ae21a8 100755 --- a/repo-encrypt +++ b/repo-encrypt @@ -45,7 +45,7 @@ if [ $1 == encrypt ]; then parent="$(pwd | sed -e 's:^/.*/\(.*$\):\1:')" tmp_dir="/tmp/${0##*/}-$$" mkdir "$tmp_dir" - cp --recursive .git "$tmp_dir/$parent.git" + cp -R .git "$tmp_dir/$parent.git" tar --directory "$tmp_dir" --create --file "$tmp_dir/$parent.git.tar" "$parent.git" gpg --encrypt --recipient "$user" < "$tmp_dir/$parent.git.tar" > "$destination/$parent.git.tar.gpg" rm -fr "$tmp_dir"