Skip to content

Instantly share code, notes, and snippets.

@AFlowOfCode
Created October 17, 2019 03:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AFlowOfCode/6704a5d56f58a016c8f3205f2c18e4e8 to your computer and use it in GitHub Desktop.
Save AFlowOfCode/6704a5d56f58a016c8f3205f2c18e4e8 to your computer and use it in GitHub Desktop.
Batch file to automatically create uploadable zip packages for a browser extension written for both Firefox and Chrome. See this repo for an example where this would be useful: https://github.com/AFlowOfCode/bandcamp-streamer
REM requires 7zip - https://www.7-zip.org/download.html
REM run this from the parent folder of the extension directory
REM excludes .git folder & other browser's manifest by default
REM change path to 7z.exe & the extension directory as needed
REM Firefox
rename "%CD%\extension\manifest-firefox.json" manifest.json
"%PROGRAMFILES%/7-zip/7z" a extension-firefox.zip .\extension\* -xr!.git -xr!manifest-chrome.json
rename "%CD%\extension\manifest.json" manifest-firefox.json
REM Chrome
rename "%CD%\extension\manifest-chrome.json" manifest.json
"%PROGRAMFILES%/7-zip/7z" a extension-chrome.zip .\extension\* -xr!.git -xr!manifest-firefox.json
rename "%CD%\extension\manifest.json" manifest-chrome.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment