add config file if not exists

This commit is contained in:
creme 2019-09-06 16:30:40 +02:00
parent 639980abdb
commit e2ec43a0fe
No known key found for this signature in database
GPG Key ID: C147C3B7FBDF08D0
1 changed files with 18 additions and 1 deletions

19
envs
View File

@ -23,10 +23,11 @@
export TERM=xterm-256color
PROGNAME=${0##*/}
VERSION="0.0.3"
VERSION="0.0.4"
INFO_FILE="$(pwd)/.envs"
###
clean_up() { # Perform pre-exit housekeeping
return
@ -161,6 +162,22 @@ sudo envs approve
EOF
}
# add default config if not exists
if [ ! -f "$INFO_FILE" ]; then
cat << EOF > "$INFO_FILE"
#
# ENVS.NET - user information config
#
# here you can add more details to youre users_info.json part
#
desc=a short describtion or message
git=
mastodon=
EOF
fi
# Trap signals
trap "signal_exit TERM" TERM HUP