remove configuration function and create config array

This commit is contained in:
Joe 2020-02-16 06:56:17 -06:00
parent af864dee5c
commit 5a6fec8213
Signed by: joe
GPG Key ID: 8595A3F8F2CE1B74
1 changed files with 8 additions and 14 deletions

22
ysm.sh
View File

@ -11,20 +11,14 @@ default_action="increment"
default_path="$HOME/.ysess"
default_s_path="$HOME/.ysess/*.ysess"
Configure() {
echo Configuring
case "$1" in
name ) echo -n "last.ysess";;
format ) echo -n "+%x_%H:%M:%S";;
action ) echo -n "increment";;
path ) echo -n "$HOME/.ysess";;
s_path ) echo -n "$HOME/.ysess/*.ysess";;
esac
}
name="$default_name"
date_format="$default_date_format"
action="$default_action"
config=(
[extension]="ysess"
[name]="last.$extension"
[format]="+%d%m%Y_%H%M%S"
[action]="increment"
[path]="$HOME/.ysess"
[s_path]="$HOME/.ysess/*.ysess"
)
CreateFiles() {
if [ ! -d "$default_path" ]; then