From 47c697be249ec64d91b87955f6640e4e99a184b2 Mon Sep 17 00:00:00 2001 From: Jon-William Lewis Date: Tue, 9 Aug 2016 19:15:33 -0500 Subject: [PATCH] Added support for version control integration --- src/includes/init_store.sns.sh | 7 +++++++ src/main/stage2.sns.sh | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/src/includes/init_store.sns.sh b/src/includes/init_store.sns.sh index 0cae7a2..5a5cbdd 100644 --- a/src/includes/init_store.sns.sh +++ b/src/includes/init_store.sns.sh @@ -25,6 +25,13 @@ ENCRYPTION="FALSE" # Main Encryption Toggle: PUBKEY="" # Public Key # Encryption is done using GPG. You must enter your # public key's identifier here. + +#VCTL="" # Version Control program + # Set this to the name of your preferred version control + # program to use it in SNS. For example, if VCTL is Set + # to `git`, `sns git ...`` will call `git ...` in SNS's + # store. This can be used to revert changes, or to sync + # across computers. EOF chmod 600 "$CONFIG_FILE" diff --git a/src/main/stage2.sns.sh b/src/main/stage2.sns.sh index 4423feb..bcc9789 100644 --- a/src/main/stage2.sns.sh +++ b/src/main/stage2.sns.sh @@ -4,7 +4,9 @@ NOTE="" if [ -z "$1" ]; then help; exit 20 else + INDEX=0 for ARG in "$@"; do + let INDEX++ case "$ARG" in -c|--create) CREATE="TRUE" @@ -39,6 +41,11 @@ else init_store exit 0 ;; + "$VCTL") + cd "$ROOT_DIR" + "${@:$INDEX}" + exit 0 + ;; *) NOTE="$ARG" break;