-
Notifications
You must be signed in to change notification settings - Fork 81
/
create_blender_addon_zip.sh
26 lines (22 loc) · 1.07 KB
/
create_blender_addon_zip.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
#!/bin/bash
# #################################################################
# Run this sh file (without parameters) to create a Blender add-on
# (photogrammetry_importer.zip), which can be installed in Blender.
# #################################################################
# Go to the directory where the script is located
cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd
if command -v git >/dev/null 2>&1; then
echo "Found git executable."
else
echo "Found NO git executable, use zip to create photogrammetry_importer.zip."
zip -r photogrammetry_importer.zip photogrammetry_importer
exit 0
fi
if git rev-parse --git-dir > /dev/null 2>&1; then
echo "Found valid git repository, use git-archive to create zip file."
# Use the HEAD of the current branch to create an archive of the subfolder photogrammetry_importer
git archive --format=zip -o photogrammetry_importer.zip HEAD photogrammetry_importer
else
echo "Found NO valid git repository, use zip to create photogrammetry_importer.zip."
zip -r photogrammetry_importer.zip photogrammetry_importer
fi