-
Notifications
You must be signed in to change notification settings - Fork 9
/
export-zip.sh
executable file
·56 lines (49 loc) · 1.57 KB
/
export-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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env bash
# Export extension as zip file for extensions.gnome.org
# ----------------------------------------------------
#
# Usage:
# ./export-zip.sh - builds extension & create zip inside repository
set -e
REPO_DIR="$(pwd)"
BUILD_DIR="${REPO_DIR}/builddir"
UUID="desktopicons-neo@darkdemon"
LOCAL_PREFIX="${REPO_DIR}/${UUID}"
EXTENSIONS_DIR="${LOCAL_PREFIX}/share/gnome-shell/extensions/${UUID}"
SCHEMADIR="${LOCAL_PREFIX}/share/glib-2.0/schemas"
# Check old builddir
if [ -d "${PWD}/${BUILD_DIR}" ]; then
echo "A current build directory already exists. Would you like to remove it?"
select yn in "Yes" "No"; do
case $yn in
Yes )
rm -rf "${PWD:?}/${BUILD_DIR}"
echo "Build directory was removed succesfuly"
break;;
No )
echo "The old build directory must be removed first. Exiting"
exit;;
esac
done
fi
# Meson build
echo "# -------------------"
echo "# Buiding with meson"
echo "# -------------------"
meson --prefix="${LOCAL_PREFIX}" --localedir=locale "${BUILD_DIR}" "${REPO_DIR}"
ninja -C "${BUILD_DIR}" install
# Create distribution ZIP file
echo -e "\\n# --------------------------"
echo "# Create extension ZIP file"
echo "# --------------------------"
rm -rf "${REPO_DIR}/${UUID}.zip" "${LOCAL_PREFIX}/${UUID}.zip"
cd "${LOCAL_PREFIX}" || exit
mkdir schemas
cp "${SCHEMADIR}"/*.xml schemas/
glib-compile-schemas schemas/
cp -r "${EXTENSIONS_DIR}"/* .
zip -qr "${UUID}.zip" ./*.js ./*.css ./*.json ./locale ./schemas
mv -f "${UUID}.zip" "${REPO_DIR}/"
cd "${REPO_DIR}" || exit
# Clean
rm -rf "${BUILD_DIR}" "${LOCAL_PREFIX}"