mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
* pyz: yeet the resource tar which is now pointless thanks to pkgres * cache impresource stuff because pyz lookups are Extremely slow * prefer tx_file when possible for slightly better performance * use hardcoded list of expected resources instead of dynamic discovery at runtime; much simpler and probably safer * fix some forgotten resources (copying.txt, insecure.pem) * fix loading jinja templates on windows
56 lines
1 KiB
Bash
Executable file
56 lines
1 KiB
Bash
Executable file
#!/bin/bash
|
|
set -e
|
|
echo
|
|
|
|
# port install gnutar gsed coreutils
|
|
gtar=$(command -v gtar || command -v gnutar) || true
|
|
[ ! -z "$gtar" ] && command -v gsed >/dev/null && {
|
|
tar() { $gtar "$@"; }
|
|
sed() { gsed "$@"; }
|
|
command -v grealpath >/dev/null &&
|
|
realpath() { grealpath "$@"; }
|
|
}
|
|
|
|
targs=(--owner=1000 --group=1000)
|
|
[ "$OSTYPE" = msys ] &&
|
|
targs=()
|
|
|
|
[ -e copyparty/__main__.py ] || cd ..
|
|
[ -e copyparty/__main__.py ] || {
|
|
echo "run me from within the project root folder"
|
|
echo
|
|
exit 1
|
|
}
|
|
|
|
[ -e sfx/copyparty/__main__.py ] || {
|
|
echo "run ./scripts/make-sfx.py first"
|
|
echo
|
|
exit 1
|
|
}
|
|
|
|
rm -rf pyz
|
|
mkdir -p pyz
|
|
cd pyz
|
|
|
|
cp -pR ../sfx/{copyparty,partftpy} .
|
|
cp -pR ../sfx/{ftp,j2}/* .
|
|
|
|
ts=$(date -u +%s)
|
|
hts=$(date -u +%Y-%m%d-%H%M%S)
|
|
ver="$(cat ../sfx/ver)"
|
|
|
|
mkdir -p ../dist
|
|
pyz_out=../dist/copyparty.pyz
|
|
|
|
echo creating loader
|
|
sed -r 's/^(VER = ).*/\1"'"$ver"'"/; s/^(STAMP = ).*/\1'$(date +%s)/ \
|
|
<../scripts/ziploader.py \
|
|
>__main__.py
|
|
|
|
echo creating pyz
|
|
rm -f $pyz_out
|
|
zip -9 -q -r $pyz_out *
|
|
|
|
echo done:
|
|
echo " $(realpath $pyz_out)"
|