ds4/tools/packs.sh
Johannes Loher 91b222a14e
Some checks failed
ci/woodpecker/pr/checks Pipeline failed
chore: switch to bun as package manager and test runner
2023-07-22 03:04:04 +02:00

29 lines
618 B
Bash
Executable file

#!/bin/bash
# SPDX-FileCopyrightText: 2023 Johannes Loher
#
# SPDX-License-Identifier: MIT
pack() {
packs=$(ls -D ./packs)
for pack in $packs; do
bunx fvtt package pack --compendiumName=$pack --inputDirectory=./packs/$pack --outputDirectory=./dist/packs
done
}
unpack() {
packs=$(ls -D ./dist/packs)
rm -rf ./packs/*
for pack in $packs; do
bunx fvtt package unpack --compendiumName=$pack --inputDirectory=./dist/packs --outputDirectory=./packs/$pack
done
}
case $1 in
"pack") pack
;;
"unpack") unpack
;;
*) echo "Usage: $0 <pack|unpack>"
;;
esac