Files
nym/documentation/remove_existing_config.sh
T
2023-11-27 12:54:12 +01:00

22 lines
636 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
# Script to remove existing ~'/.nym/ files on docs deployment. Used to avoid issues with `mdbook-cmdrun` output when
# e.g. erroring about overwriting existing keys. `mdbook-cmdrun` output for the moment has to be checked manually.
DIR=~/.nym
# check for config directory
if [ ! -d $DIR ]; then
echo "config dir doesn't exist: nothing to do (✿◠‿◠)"
else
echo "config dir exists - deleting"
rm -rf $DIR
if [ $? -ne 0 ]; then
echo "(0´) exit code was $0. looks like the something went wrong with deleting the directory"
exit 1
fi
fi