web-ext
web-ext copied to clipboard
Add ability to build zip file without version string in file name
Is this a bug or feature request?
feature
What is the current behavior?
web-ext build command creates zip file including version string, for example myextension-1.0.0.zip.
(If this is a bug, please include the exact steps to reproduce the problem, including the
web-ext commands you ran. Do not include sensitive information like API secrets.
Upload a text log created with the --verbose flag if possible.
Upload a .zip file of your web extension source if necessary.)
What is the expected or desired behavior?
It would be nice if there is an option for build command which creates zip file without version string, like --without-version?
Version information (for bug reports)
- Firefox version:
- Your OS and version:
- Paste the output of these commands:
node --version && npm --version && web-ext --version
v7.7.2 4.3.0 1.8.1
Why do you want to remove the version? Just curious.
We could add a new option like build --filename="some-file.zip". However, to make it useful, it should also accept parameters for substitution like build --filename="%{artifactsDir}/%{name}-%{version}.zip"
In most cases (at least in my case), one latest zip file is enough. Old zip file will never be used. Currently, when building a new zip file you need to delete the old file yourself. If you forget to delete it and push a commit to GitHub, then you have to create another commit just to delete the old one. It's annoying and such careless mistakes can often happen. If the file name of the zip file is always the same (that is, without a version string), it will be much easier to maintain.
ah, that makes sense.
Would also appreciate a --filename flag for both build and sign. My XPI is returned with version and two additional suffix hints (-
That would have to be fixed in https://github.com/mozilla/sign-addon
We could add a new option like build --filename="some-file.zip". However, to make it useful, it should also accept parameters for substitution like build --filename="%{artifactsDir}/%{name}-%{version}.zip"
Can this issue be renamed to reflect this desired change? Ie something like Add a new option like build --filename="some-file.zip" - or should I file a new issue to target the --filename option?
Having the path as part of the filename option would be misleading (%{artifactsDir}/) since there is already an option for that.
However, to have the parameters correspond to manifest contents would be great. We would use the following command: build --filename="%{applications.gecko.id}-%{version}.zip
EDIT: Reported as separate issue here: https://github.com/mozilla/web-ext/issues/1335
A manual fix for your .zip files downloaded from GitHub (tested on MacOS).
unzip easy-key-values-1.0.0.zip && mv easy-key-values-1.0.0 easy-key-values && zip -rm easy-key-values.zip easy-key-values
Explanation:
- Extract
easy-key-values-1.0.0.zip - Rename the folder from
easy-key-values-1.0.0toeasy-key-values - Create a zip file named
easy-key-values.zipcontaining the renamed folder and remove the original folder
This feature request was resolved by #1900.
A manual fix for your .zip files downloaded from GitHub (tested on MacOS).
unzip easy-key-values-1.0.0.zip && mv easy-key-values-1.0.0 easy-key-values && zip -rm easy-key-values.zip easy-key-valuesExplanation:
- Extract
easy-key-values-1.0.0.zip- Rename the folder from
easy-key-values-1.0.0toeasy-key-values- Create a zip file named
easy-key-values.zipcontaining the renamed folder and remove the original folder
This comment is unrelated to the request here. The request is about generating a zip file with a custom filename, whereas your comment explains how to strip a directory prefix from entries inside a zip file.