Skip to content

Commit

Permalink
fix: web-ext sign no longer logs an irrelevant temp directory path (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
saintsebastian authored and kumar303 committed Oct 17, 2016
1 parent 74a208d commit 441b1b6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
13 changes: 9 additions & 4 deletions src/cmd/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export type PackageCreatorParams = {
sourceDir: string,
fileFilter: FileFilter,
artifactsDir: string,
showReadyMessage: boolean
};

export type LocalizedNameParams = {
Expand Down Expand Up @@ -78,8 +79,8 @@ export type PackageCreatorFn =
(params: PackageCreatorParams) => Promise<ExtensionBuildResult>;

async function defaultPackageCreator(
{manifestData, sourceDir, fileFilter, artifactsDir}: PackageCreatorParams
): Promise<ExtensionBuildResult> {
{manifestData, sourceDir, fileFilter, artifactsDir, showReadyMessage,
}: PackageCreatorParams): Promise<ExtensionBuildResult> {
let id;
if (manifestData) {
id = getManifestId(manifestData);
Expand Down Expand Up @@ -110,7 +111,9 @@ async function defaultPackageCreator(

await streamToPromise(stream);

log.info(`Your web extension is ready: ${extensionPath}`);
if (showReadyMessage) {
log.info(`Your web extension is ready: ${extensionPath}`);
}
return {extensionPath};
}

Expand All @@ -128,6 +131,7 @@ export type BuildCmdOptions = {
fileFilter?: FileFilter,
onSourceChange?: OnSourceChangeFn,
packageCreator?: PackageCreatorFn,
showReadyMessage?: boolean
};

export default async function build(
Expand All @@ -136,13 +140,14 @@ export default async function build(
manifestData, fileFilter = new FileFilter(),
onSourceChange = defaultSourceWatcher,
packageCreator = defaultPackageCreator,
showReadyMessage = true,
}: BuildCmdOptions = {}
): Promise<ExtensionBuildResult> {
const rebuildAsNeeded = asNeeded; // alias for `build --as-needed`
log.info(`Building web extension from ${sourceDir}`);

const createPackage = () => packageCreator({
manifestData, sourceDir, fileFilter, artifactsDir,
manifestData, sourceDir, fileFilter, artifactsDir, showReadyMessage,
});

await prepareArtifactsDir(artifactsDir);
Expand Down
3 changes: 2 additions & 1 deletion src/cmd/sign.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ export default function sign(
}

let [buildResult, idFromSourceDir] = await Promise.all([
build({sourceDir, artifactsDir: tmpDir.path()}, {manifestData}),
build({sourceDir, artifactsDir: tmpDir.path()},
{manifestData, showReadyMessage: false}),
getIdFromSourceDir(sourceDir),
]);

Expand Down

0 comments on commit 441b1b6

Please sign in to comment.