mirror of
https://gitlab.com/sagidayan/linux-config.git
synced 2024-11-22 15:25:25 +00:00
workspace manager: when adding same name ask to override
This commit is contained in:
parent
ba74923f3a
commit
fe3b4dd7ee
1 changed files with 13 additions and 0 deletions
|
@ -14,6 +14,19 @@ if [ -z "$NAME" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Check if workspace already exists
|
||||||
|
if [ $(cat $JSON_PATH | jq 'keys' | grep "${NAME}") ]; then
|
||||||
|
OVERRIDE=$(cat <<EOF | fzf --reverse --header "a Worspace with name '${NAME}' already exists. Override?"
|
||||||
|
No
|
||||||
|
Yes
|
||||||
|
EOF
|
||||||
|
)
|
||||||
|
if [[ "$OVERRIDE" == "No" ]]; then
|
||||||
|
echo Canceled
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
CURRENT_DIR=$(pwd)
|
CURRENT_DIR=$(pwd)
|
||||||
|
|
||||||
LAYOUT=$(cat <<EOF | fzf --reverse --header "Select a layout for ${NAME}"
|
LAYOUT=$(cat <<EOF | fzf --reverse --header "Select a layout for ${NAME}"
|
||||||
|
|
Loading…
Reference in a new issue