Make volume logic work with absolute paths

This commit is contained in:
Girish Ramakrishnan
2019-01-13 19:18:06 -08:00
parent 17ac6bb1a4
commit 898f1dd151
3 changed files with 30 additions and 28 deletions

View File

@@ -17,14 +17,11 @@ if [[ "$1" == "--check" ]]; then
exit 0
fi
appid="$1"
subdir="$2"
volume_dir="$1"
if [[ "${BOX_ENV}" == "cloudron" ]]; then
readonly volume_dir="${HOME}/appsdata/${appid}/${subdir}"
else
readonly volume_dir="${HOME}/.cloudron_test/appsdata/${appid}/${subdir}"
if [[ "${BOX_ENV}" == "test" ]]; then
# be careful not to nuke some random directory when testing
[[ "${volume_dir}" != *"./cloudron_test/"* ]] && exit 1
fi
rm -rf "${volume_dir}"