mirror of
https://gitlab.com/sagidayan/linux-config.git
synced 2024-09-20 03:17:34 +00:00
18 lines
368 B
Bash
18 lines
368 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
JSON_PATH=~/.shellconfig/workspaces/workspaces.json
|
||
|
|
||
|
WSP=$(cat ${JSON_PATH} \
|
||
|
| jq -r 'keys[]' \
|
||
|
| fzf --reverse --header "Select a Workspace to DELETE"
|
||
|
)
|
||
|
|
||
|
if [ -z $WSP ]; then
|
||
|
echo "Aborted"
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
echo $(cat ${JSON_PATH} | jq --arg WSP "$WSP" 'del(.[$WSP])') > ${JSON_PATH}
|
||
|
|
||
|
echo "⚠️ '${WSP}' Was removed from your workspaces"
|