forked from gildas-lormeau/SingleFile
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-extension.sh
More file actions
executable file
·34 lines (26 loc) · 907 Bytes
/
build-extension.sh
File metadata and controls
executable file
·34 lines (26 loc) · 907 Bytes
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
#!/bin/bash
dpkg -s zip &> /dev/null
if [ $? -ne 0 ]
then
if ! command -v zip &> /dev/null; then
echo "Installing zip"
sudo apt install zip
fi
fi
dpkg -s jq &> /dev/null
if [ $? -ne 0 ]
then
if ! command -v jq &> /dev/null; then
echo "Installing jq"
sudo apt install jq
fi
fi
npm install
npm update
npx rollup -c rollup.config.js
zip -r singlefile-extension-source.zip manifest.json package.json _locales src rollup*.js eslint.config.mjs build-extension.sh
rm -f singlefile-extension-firefox.zip
cp src/core/bg/config.js config.copy.js
node -e "const fs=require('fs');const file='src/core/bg/config.js';const updated=fs.readFileSync(file,'utf8').replace(/forceWebAuthFlow: false/g,'forceWebAuthFlow: true');fs.writeFileSync(file,updated);"
zip -r singlefile-extension-firefox.zip manifest.json lib _locales src
mv config.copy.js src/core/bg/config.js