Skip to content

Commit

Permalink
Fix Extra Directory Creation When Option Is Given
Browse files Browse the repository at this point in the history
  • Loading branch information
LoganBresnahan committed May 6, 2021
1 parent 1b09d41 commit e634e1b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions meow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,10 @@ read_meow_txt_file() {
START_OF_COMMANDS=false
FIRST_COMMAND=false
GROUP_NUMBER=0
MEOW_CREATED_DIR=false

if [ ! -d "$CONFIG_RELATIVE_DIRECTORY" ]; then
MEOW_CREATED_DIR=true
mkdir $CONFIG_RELATIVE_DIRECTORY
fi

Expand All @@ -212,13 +214,18 @@ read_meow_txt_file() {
if linebeginswith "--end-config" $line; then
START_OF_CONFIG=false
elif linebeginswith "writable-relative-directory=" $line; then
ORIGINAL_RELATIVE_DIRECTORY=$CONFIG_RELATIVE_DIRECTORY
CONFIG_RELATIVE_DIRECTORY="${line##*=}"

if [ ! -d "$CONFIG_RELATIVE_DIRECTORY" ]; then
mkdir $CONFIG_RELATIVE_DIRECTORY
fi

CONFIG_RELATIVE_DIRECTORY=`pwd`/$CONFIG_RELATIVE_DIRECTORY

if [ "$ORIGINAL_RELATIVE_DIRECTORY" != "$CONFIG_RELATIVE_DIRECTORY" ] && [ "$MEOW_CREATED_DIR" = true ]; then
rmdir $ORIGINAL_RELATIVE_DIRECTORY &>/dev/null
fi
elif linebeginswith "unix-shell=" $line; then
# Variable is used in the gnome_terminal function.
CONFIG_UNIX_SHELL="${line##*=}"
Expand Down

0 comments on commit e634e1b

Please sign in to comment.