build-extension.sh 2.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/sh
  2. rm singlefile-extension-firefox.zip singlefile-extension-chromium.zip singlefile-extension-edge.zip
  3. cp manifest.json manifest.copy.json
  4. cp extension/core/bg/downloads.js downloads.copy.js
  5. sed -i 's/207618107333-3pj2pmelhnl4sf3rpctghs9cean3q8nj/207618107333-7tjs1im1pighftpoepea2kvkubnfjj44/g' extension/core/bg/downloads.js
  6. cp extension/core/bg/config.js config.copy.js
  7. cp extension/core/bg/companion.js companion.copy.js
  8. jq "del(.options_page,.background.persistent,.optional_permissions[0],.optional_permissions[1],.permissions[2],.oauth2)" manifest.copy.json > manifest.json
  9. sed -i 's/207618107333-3pj2pmelhnl4sf3rpctghs9cean3q8nj/207618107333-7tjs1im1pighftpoepea2kvkubnfjj44/g' manifest.json
  10. sed -i 's/forceWebAuthFlow: false/forceWebAuthFlow: true/g' extension/core/bg/config.js
  11. sed -i 's/enabled: true/enabled: false/g' extension/core/bg/companion.js
  12. zip -r singlefile-extension-firefox.zip manifest.json common extension lib/single-file/dist _locales lib/single-file/processors/hooks/content/*-web.js
  13. mv config.copy.js extension/core/bg/config.js
  14. mv companion.copy.js extension/core/bg/companion.js
  15. jq "del(.browser_specific_settings,.permissions[0],.permissions[1],.permissions[2],.options_ui.browser_style)" manifest.copy.json > manifest.json
  16. sed -i 's/207618107333-3pj2pmelhnl4sf3rpctghs9cean3q8nj/207618107333-7tjs1im1pighftpoepea2kvkubnfjj44/g' manifest.json
  17. zip -r singlefile-extension-chromium.zip manifest.json common extension lib/single-file/dist _locales lib/single-file/processors/hooks/content/*-web.js
  18. cp extension/core/bg/config.js config.copy.js
  19. jq "del(.browser_specific_settings,.permissions[0],.permissions[1],.permissions[2],.options_ui.browser_style)" manifest.copy.json > manifest.json
  20. sed -i 's/207618107333-3pj2pmelhnl4sf3rpctghs9cean3q8nj/207618107333-7tjs1im1pighftpoepea2kvkubnfjj44/g' manifest.json
  21. sed -i 's/forceWebAuthFlow: false/forceWebAuthFlow: true/g' extension/core/bg/config.js
  22. mkdir _locales.copy
  23. cp -R _locales/* _locales.copy
  24. rm -rf _locales/*
  25. cp -R _locales.copy/en _locales
  26. zip -r singlefile-extension-edge.zip manifest.json common extension lib/single-file/dist _locales lib/single-file/processors/hooks/content/*-web.js
  27. rm -rf _locales/*
  28. mv _locales.copy/* _locales
  29. rmdir _locales.copy
  30. mv config.copy.js extension/core/bg/config.js
  31. mv manifest.copy.json manifest.json
  32. mv downloads.copy.js extension/core/bg/downloads.js