web-ext icon indicating copy to clipboard operation
web-ext copied to clipboard

Add ability to build zip file without version string in file name

Open asamuzaK opened this issue 8 years ago • 6 comments

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

asamuzaK avatar Mar 10 '17 15:03 asamuzaK

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"

kumar303 avatar Mar 10 '17 20:03 kumar303

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.

asamuzaK avatar Mar 11 '17 01:03 asamuzaK

ah, that makes sense.

kumar303 avatar Mar 11 '17 02:03 kumar303

Would also appreciate a --filename flag for both build and sign. My XPI is returned with version and two additional suffix hints (--an+fx.xpi). Signing in AMO with targeted support for a few platforms also generates multiple XPIs per platform. It would be great to know the exact signature of the output to assist in uploading for self-distribution.

mattduggan avatar Oct 26 '17 14:10 mattduggan

That would have to be fixed in https://github.com/mozilla/sign-addon

kumar303 avatar Oct 26 '17 18:10 kumar303

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

motin avatar Mar 22 '18 08:03 motin

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:

  1. Extract easy-key-values-1.0.0.zip
  2. Rename the folder from easy-key-values-1.0.0 to easy-key-values
  3. Create a zip file named easy-key-values.zip containing the renamed folder and remove the original folder

ysalitrynskyi avatar Feb 23 '24 03:02 ysalitrynskyi

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-values

Explanation:

  1. Extract easy-key-values-1.0.0.zip
  2. Rename the folder from easy-key-values-1.0.0 to easy-key-values
  3. Create a zip file named easy-key-values.zip containing 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.

Rob--W avatar Feb 23 '24 07:02 Rob--W