-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.sh
executable file
·47 lines (42 loc) · 1003 Bytes
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env bash
# Fail on error
set -e
VIRTUAL_ENV_PATH="venv"
function print_help() {
echo ""
echo "Utility script for building and publishing package"
echo ""
echo "Usage: build command1 [command2] [command3...]"
echo ""
echo "Positional arguments"
echo "command Command to run"
echo ""
}
source "${VIRTUAL_ENV_PATH}/bin/activate"
if [[ $# -eq 0 ]]; then
print_help
exit 1
fi
while [[ $# -gt 0 ]]
do
command="$1"
case $command in
clean)
echo "Cleaning build output dirs"
rm -rf ./build/*
rm -rf ./dist/*
rm -rf ./*.egg-info
;;
build)
echo "Building wheel package"
python setup.py bdist_wheel
echo "Building source distribution"
python setup.py sdist
;;
publish)
echo "Uploading packages on PyPi"
twine upload -u logicify dist/*
;;
esac
shift
done