forked from heremaps/xyz-qgis-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakeBuild.sh
27 lines (24 loc) · 1007 Bytes
/
makeBuild.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
[[ "$#" -lt 1 ]] && echo No version given. Exiting.. && exit
ver=$1
# if [ "$#" -lt 1 ]; then
# ver=dev
# else
# ver=$1
# fi
mkdir -p build
rm -r build/*/ # delete folders only
# lst=$(git ls-files XYZHubConnector | grep -v '/\.') # input files are all files in XYZHubConnector folder
# lst=$(git ls-tree --name-only -r master XYZHubConnector | grep -v '/\.') # input files is staged in git (master)
lst=$(git ls-tree --name-only -r HEAD XYZHubConnector | grep -v '/\.') # input files is staged in git HEAD
for f in $lst ; do
echo $f
git --work-tree=build checkout HEAD -- $f # checkout from git instead of copy current local files
done
# cp --parents $lst build # copy current local files
## Install lib
pip install -r requirements.txt -t build/XYZHubConnector/external
find build/XYZHubConnector -ipath '*/__pycache__' -type d | xargs rm -r
### Zip file
# cd build && zip -q -r QGIS-XYZ-Plugin-$ver.zip XYZHubConnector
cd build && python ../zip_dir.py XYZHubConnector QGIS-XYZ-Plugin-$ver.zip
cd ..