-
Notifications
You must be signed in to change notification settings - Fork 39
/
push.sh
executable file
·37 lines (28 loc) · 897 Bytes
/
push.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
#!/bin/sh
# Check if parameters aren't provided
if [ "$#" -ne 3 ] ; then
# Display error and exit
echo "Provide type, version, and comment parameters, like release 0.1 \"test\""
exit
fi
# Check if releasing a new version
if [ $1 = "release" ]; then
# Change version string to version
sed -i "s/.*plugin_version = .*/plugin_version = \"$2\"/" setup.py
# Otherwise
else
# Change version string to date
sed -i "s/.*plugin_version = .*/plugin_version = \"$2.`date +%Y%m%d%H`\"/" setup.py
fi
# Remove backup and python byte code files
find ./ -name '*~' -print0 | xargs -0 rm
find ./ -name '*.pyc' -print0 | xargs -0 rm
# Update bundled translations
#python setup.py babel_refresh
#pybabel compile -d translations
#python setup.py babel_bundle --locale=
#find "octoprint_m33fio/translations" -maxdepth 1 -type f -delete
# Push changes
git add .
git commit -m "$3"
git push origin devel