Check for empty parameters
This commit is contained in:
parent
c588eae642
commit
551ac17896
1 changed files with 8 additions and 0 deletions
|
@ -111,12 +111,20 @@ function populateConfig() {
|
|||
}
|
||||
|
||||
function checkBackupDir() {
|
||||
if [[ -z "$1" ]]; then {
|
||||
log e "Parameters can't be empty!"
|
||||
exit 1
|
||||
}
|
||||
if [[ ! -d "$(getValueByKey 'PODMAN_DIRECTORY')/${1}/backup" ]]; then
|
||||
mkdir -p "$(getValueByKey 'PODMAN_DIRECTORY')/${1}/backup"
|
||||
fi
|
||||
}
|
||||
|
||||
function checkDatapackDir() {
|
||||
if [[ -z "$1" ]]; then {
|
||||
log e "Parameters can't be empty!"
|
||||
exit 1
|
||||
}
|
||||
if [[ ! -d "$(getValueByKey 'PODMAN_DIRECTORY')/${1}/data/world/datapacks" ]]; then
|
||||
mkdir -p "$(getValueByKey 'PODMAN_DIRECTORY')/${1}/data/world/datapacks"
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue