-
Notifications
You must be signed in to change notification settings - Fork 335
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
feat: Add file extension option to web-ext build
#392
Conversation
@@ -182,6 +182,10 @@ Example: $0 --help run. | |||
describe: 'Watch for file changes and re-build as needed', | |||
type: 'boolean', | |||
}, | |||
'extension': { | |||
describe: 'Change the file extension from .zip to something else', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make it clear that the value should not include a dot, maybe add another sentence: "Example: --extension=xpi"
Thanks! I figured someone would ask for this eventually :) Comments added. |
@rhelmer I guess you found a workaround but did you still want to get this in? |
Yep, sorry for the delay. |
10fb598
to
3556526
Compare
|
||
it('throws an error when invalid extension is provided', () => { | ||
let failed = false; | ||
try { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all callers will expect to treat build()
's return value as a promise so I think it's time to wrap the first part of that function in a promise:
return new Promise(
(resolve) => {
if (!allowedExtension.test(fileExtension)) {
throw new Error('...');
}
resolve();
})
.then(() => prepareArtifactsDir(artifactsDir));
@rpl is embarking on an epic patch to switch us to async/await! #411
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after that change, here's the pattern we use to check for promise rejections.
Now that we landed improved static typing, this patch will need a rebase and considerable cleanup. If you want to close it and just wait until someone needs the feature, that's fine. I am happy to review it again if you want to resurrect it though. |
@kumar303 well I am using it, happy to rebase and cleanup :) |
Hi @rhelmer . We landed a big change on master that switches to async/await instead of promises. This should make your patch easier though :) The tests still use promises (for now). |
We're getting a bit overwhelmed with pull requests so I'm trying to clear some mental space on the tracker. Feel free to re-open this if you feel like working on it! |
Fixes #393