-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpack.sh
executable file
·31 lines (24 loc) · 997 Bytes
/
pack.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
#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)
# if MacOS
if [[ "$OSTYPE" == "darwin"* ]]; then
EXECUTABLE="/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome"
else
EXECUTABLE="google-chrome-stable"
fi
rm -f dist.crx \
studio-ui-enhancer-extension.crx \
studio-ui-enhancer-extension.zip \
chrome-web-store/studio-ui-enhancer-extension.crx \
chrome-web-store/studio-ui-enhancer-extension.zip
npm run build
(cd dist && zip -q -r -X ../chrome-web-store/studio-ui-enhancer-extension.zip . -x "*.DS_Store")
echo Generated studio-ui-enhancer-extension.zip
if [ -f "$SCRIPT_DIR/extension-private-key.pem" ]; then
eval $EXECUTABLE --pack-extension="$SCRIPT_DIR/dist" --pack-extension-key="$SCRIPT_DIR/extension-private-key.pem"
mv dist.crx chrome-web-store/studio-ui-enhancer-extension.crx
echo Generated studio-ui-enhancer-extension.crx
else
echo "No private key found, skipping crx generation"
fi