#!/bin/bash set -e echo # osx support # port install gnutar findutils gsed coreutils gtar=$(command -v gtar || command -v gnutar) || true [ ! -z "$gtar" ] && command -v gfind >/dev/null && { tar() { $gtar "$@"; } sed() { gsed "$@"; } find() { gfind "$@"; } sort() { gsort "$@"; } command -v grealpath >/dev/null && realpath() { grealpath "$@"; } } mode="$1" [ -z "$mode" ] && { echo "need argument 1: (D)ry, (T)est, (U)pload" echo exit 1 } [ -e copyparty/__main__.py ] || cd .. [ -e copyparty/__main__.py ] || { echo "run me from within the copyparty folder" echo exit 1 } # one-time stuff, do this manually through copy/paste true || { cat > ~/.pypirc <$f) tar --strip-components=2 -xf $f strip-hints-0.1.10/src/strip_hints python3 -c 'from strip_hints.a import uh; uh("copyparty")' ./setup.py clean2 ./setup.py sdist bdist_wheel --universal [ "$mode" == t ] && twine upload -r pypitest dist/* [ "$mode" == u ] && twine upload -r pypi dist/* cat <