pms-cli/utils/datapack
LinuxSquare c443106584 Add delete function
* Fixed missing ! in error messages
2024-03-16 17:50:53 +01:00

12 lines
311 B
Bash

#!/usr/bin/env bash
function datapack() {
if [[ ! -d "$(getValueByKey 'PODMAN_DIRECTORY')/${1}" ]]; then
log e "Directory '${1}' does not exist!"
exit 1
fi
local dir="$(getValueByKey 'PODMAN_DIRECTORY')/${1}/data/world/datapacks"
curl -L "${2}" -o "$dir/$(echo $2 | awk -F/ '{print $NF}')"
}