-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
41 lines (33 loc) · 1.08 KB
/
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
#!usr/bin/env bash
# bash build.sh YYYY.M.D
echo "=== Building uhubctl ===";
echo "";
# Take inputs
dt=`date +"%y.%-m.%-d"alpha`;
echo "Settings:";
version="${1:-$dt}";
echo "- Version: $version";
echo ""
# Delete and recreate the build directory
rm -rf Octoprint-uhubctl
rm -rf Octoprint-uhubctl.zip
mkdir Octoprint-uhubctl
# Copy files ans folders we need in the build
cp -r extras Octoprint-uhubctl/extras # this is empty so copy wont move it
cp -r octoprint_uhubctl Octoprint-uhubctl/octoprint_uhubctl
cp -r translations Octoprint-uhubctl/translations
cp babel.cfg Octoprint-uhubctl/babel.cfg
cp LICENSE.txt Octoprint-uhubctl/LICENSE.txt
cp MANIFEST.in Octoprint-uhubctl/MANIFEST.in
cp requirements.txt Octoprint-uhubctl/requirements.txt
cp setup.py Octoprint-uhubctl/setup.py
# Rewrite version
echo -n "Writing plugin version... "
sed -i "s/plugin_version = \"VERSION\"/plugin_version = \"$version\"/" Octoprint-uhubctl/setup.py
echo "done"
# Compress the build directory
echo -n "Zipping... ";
zip -q -r Octoprint-uhubctl.zip Octoprint-uhubctl
rm -rf Octoprint-uhubctl
echo "done";
echo "Done.";