Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
asamuzaK opened this issue Mar 10, 2017 · 8 comments
Closed

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

asamuzaK opened this issue Mar 10, 2017 · 8 comments

Comments

@asamuzaK
Copy link

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

@kumar303
Copy link
Contributor

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"

@asamuzaK
Copy link
Author

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.

@kumar303
Copy link
Contributor

ah, that makes sense.

@mattduggan
Copy link

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.

@kumar303
Copy link
Contributor

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

@motin
Copy link

motin commented Mar 22, 2018

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: #1335

@ysalitrynskyi
Copy link

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

@Rob--W
Copy link
Member

Rob--W commented Feb 23, 2024

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 Rob--W closed this as completed Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants