Cleanup
This commit is contained in:
@@ -4,6 +4,7 @@ if [ ! -d "$ROOT_DIR" ]; then mkdir -p "$ROOT_DIR" ; WILL_INIT="TRUE"; fi
|
||||
if [ ! -d "$TMP_DIR" ]; then mkdir -p "$TMP_DIR" ; WILL_INIT="TRUE"; fi
|
||||
if [ ! -d "$NOTES_DIR" ]; then mkdir -p "$NOTES_DIR"; fi
|
||||
|
||||
if [ ! -r "$CONFIG_FILE" ]; then
|
||||
cat > "$CONFIG_FILE" << EOF
|
||||
# This file contains directives for the Simple Note System.
|
||||
|
||||
@@ -26,21 +27,19 @@ PUBKEY="" # Public Key
|
||||
# Encryption is done using GPG. You must enter your
|
||||
# public key's identifier here.
|
||||
|
||||
#VCTL="" # Version Control program
|
||||
#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.
|
||||
# program to use it in SNS. Examples: git, hg, svn
|
||||
EOF
|
||||
|
||||
chmod 600 "$CONFIG_FILE"
|
||||
|
||||
printf " - %s\n" "Rewrote Default Configuration"
|
||||
|
||||
if [ "$WILL_INIT" == "TRUE" ]; then
|
||||
printf " - %s\n" "Environment initialized in $ROOT_DIR"
|
||||
printf "%s\n" "- Rewrote Default Configuration"
|
||||
else
|
||||
printf " - %s\n" "Store already initialized."
|
||||
printf "$RED_COLOR!$RESET_COLOR - %s" "Refusing to overwrite existing config"
|
||||
fi
|
||||
|
||||
if [ "$WILL_INIT" == "TRUE" ]; then
|
||||
printf "%s\n" "- Environment initialized in $ROOT_DIR"
|
||||
else
|
||||
printf "%s\n" "- Store already initialized."
|
||||
fi
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user