Skip to content

Commit 98928ce

Browse files
committed
build.sh without temp files
1 parent 18ffe74 commit 98928ce

File tree

3 files changed

+34
-30
lines changed

3 files changed

+34
-30
lines changed

build.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/sh
2+
set -e
3+
4+
cd "$(dirname "$0")"
5+
6+
INPUT=$1
7+
INNOBIN=$2
8+
9+
SCRIPT=$(cat "$INPUT")
10+
11+
# Add licences to header
12+
HASHEDLIC=$(sed 's/^/# /' < LICENSE)
13+
INNOLIC='###
14+
# This script uses a fork of "innoextract" licensed under the zlib/libpng license.
15+
#
16+
# Original innoextract (c) Daniel Scharrer <[email protected]> https://constexpr.org/innoextract/
17+
# Fork by Jozen Blue Martinez for ZOOM Platform https://github.com/doZennn/innoextract
18+
###'
19+
SCRIPT=$(printf "%s" "$SCRIPT" | awk -v r="###\n$HASHEDLIC\n###\n\n$INNOLIC" '{gsub(/#__LICENSE_HERE__/,r)}1')
20+
21+
# set version to either release tag or commit hash
22+
VERSION=$(git tag --points-at HEAD)
23+
[ -z "$VERSION" ] && VERSION="git-$(git rev-parse --short=7 HEAD)"
24+
SCRIPT=$(printf "%s" "$SCRIPT" | sed "s/INSTALLER_VERSION=\"DEV\"/INSTALLER_VERSION=\"$VERSION\"/")
25+
26+
# Add innoextract binary between comments
27+
START=$(printf "%s" "$SCRIPT" | sed -n '1,/^#__INNOEXTRACT_BINARY_START__/p')
28+
# shellcheck disable=SC2016
29+
END=$(printf "%s" "$SCRIPT" | sed -n '/^#__INNOEXTRACT_BINARY_END__$/,${p;}')
30+
INNOB64=$(base64 -w 0 "$INNOBIN")
31+
printf '%s\nINNOEXTRACT_BINARY_B64=%s\n%s' "$START" "$INNOB64" "$END"

dist.sh

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,9 @@
11
#!/bin/sh
2-
32
set -e
43

4+
cd "$(dirname "$0")"
55
FINAL_FILE="zoom-platform.sh"
66

7-
cp "src.sh" "$FINAL_FILE"
8-
9-
# Add licences to header
10-
HASHEDLIC=$(sed 's/^/# /' < LICENSE)
11-
INNOLIC='###
12-
# This script uses a fork of "innoextract" licensed under the zlib/libpng license.
13-
#
14-
# Original innoextract (c) Daniel Scharrer <[email protected]> https://constexpr.org/innoextract/
15-
#
16-
# Fork by Jozen Blue Martinez for ZOOM Platform https://github.com/doZennn/innoextract
17-
###'
18-
19-
awk -i inplace -v r="###\n$HASHEDLIC\n###\n\n$INNOLIC" '{gsub(/#__LICENSE_HERE__/,r)}1' "$FINAL_FILE"
20-
21-
# set version to either release tag or commit hash
22-
VERSION=$(git tag --points-at HEAD)
23-
if [ -z "$VERSION" ]; then VERSION="git-$(git rev-parse --short HEAD)"; fi
24-
sed -i "s/INSTALLER_VERSION=\"DEV\"/INSTALLER_VERSION=\"$VERSION\"/" "$FINAL_FILE"
25-
267
# Download innoextract binaries
278
rm -f innoextract.tar.gz innoextract-upx.tar.gz
289
INNOEXT_URLS=$(curl -s "https://api.github.com/repos/doZennn/innoextract/releases/latest" | grep '"browser_download_url":.*innoextract.*.tar.gz' | sed -E 's/.*"([^"]+)".*/\1/')
@@ -31,12 +12,4 @@ echo "$INNOEXT_URLS" | wget -nv -i -
3112
# Extract binaries
3213
tar -xzf innoextract-upx.tar.gz
3314

34-
# Add innoextract binary between comments
35-
START="$(sed -n '1,/^#__INNOEXTRACT_BINARY_START__/p' "$FINAL_FILE")"
36-
# shellcheck disable=SC2016
37-
END="$(sed -n '/^#__INNOEXTRACT_BINARY_END__$/,${p;}' "$FINAL_FILE")"
38-
printf '%s\nINNOEXTRACT_BINARY_B64=' "$START" > "$FINAL_FILE"
39-
base64 -w 0 innoextract-upx >> "$FINAL_FILE"
40-
printf '\n%s' "$END" >> "$FINAL_FILE"
41-
42-
chmod +x "$FINAL_FILE"
15+
./build.sh "src.sh" "innoextract-upx" > "$FINAL_FILE"

src.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ dialog_installer_select() {
3636
zenity --file-selection --title="Select a ZOOM Platform installer"
3737
return $?
3838
else
39-
kdialog --getopenfilename . "ZOOM Platform Windows installer (*.exe)" --title "Select a ZOOM Platform installer"
39+
kdialog --getopenfilename . "ZOOM Platform Windows installer(*.exe)" --title "Select a ZOOM Platform installer"
4040
return $?
4141
fi
4242
}

0 commit comments

Comments
 (0)