Skip to content

Commit

Permalink
fix: Fixed bug where --ignore-files had no effect on web-ext sign (
Browse files Browse the repository at this point in the history
  • Loading branch information
felixgirault authored and kumar303 committed Mar 9, 2017
1 parent 33639da commit 333062c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/cmd/sign.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export type SignParams = {|
verbose?: boolean,
sourceDir: string,
artifactsDir: string,
ignoreFiles?: Array<string>,
apiKey: string,
apiSecret: string,
apiUrlPrefix: string,
Expand All @@ -45,8 +46,8 @@ export type SignResult = {|

export default function sign(
{
verbose, sourceDir, artifactsDir, apiKey, apiSecret,
apiUrlPrefix, apiProxy, id, timeout,
verbose, sourceDir, artifactsDir, ignoreFiles = [],
apiKey, apiSecret, apiUrlPrefix, apiProxy, id, timeout,
}: SignParams,
{
build = defaultBuilder, signAddon = defaultAddonSigner,
Expand All @@ -66,7 +67,7 @@ export default function sign(
}

const [buildResult, idFromSourceDir] = await Promise.all([
build({sourceDir, artifactsDir: tmpDir.path()},
build({sourceDir, ignoreFiles, artifactsDir: tmpDir.path()},
{manifestData, showReadyMessage: false}),
getIdFromSourceDir(sourceDir),
]);
Expand Down
12 changes: 12 additions & 0 deletions tests/unit/test-cmd/test.sign.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,18 @@ describe('sign', () => {
}
));

it('passes the ignoreFiles flag to the builder', () => withTempDir(
(tmpDir) => {
const stubs = getStubs();
const ignoreFiles = ['*'];
return sign(tmpDir, stubs, {extraArgs: {ignoreFiles}})
.then(() => {
assert.equal(stubs.signAddon.called, true);
assert.equal(stubs.build.firstCall.args[0].ignoreFiles, ignoreFiles);
});
}
));

it('passes through a signing exception', () => withTempDir(
(tmpDir) => {
const stubs = getStubs();
Expand Down

0 comments on commit 333062c

Please sign in to comment.