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ec, InvalidConfigurationError, log } from \"builder-util\"\nimport chalk from \"chalk\"\nimport { getElectronVersion } from \"app-builder-lib/out/electron/electronVersion\"\nimport { getGypEnv } from \"app-builder-lib/out/util/yarn\"\nimport { readJson } from \"fs-extra\"\nimport isCi from \"is-ci\"\nimport * as path from \"path\"\nimport { loadEnv } from \"read-config-file\"\nimport updateNotifier from \"update-notifier\"\nimport { ExecError } from \"builder-util/out/util\"\nimport { build, configureBuildCommand, createYargs } from \"../builder\"\nimport { createSelfSignedCert } from \"./create-self-signed-cert\"\nimport { configureInstallAppDepsCommand, installAppDeps } from \"./install-app-deps\"\nimport { start } from \"./start\"\n\n// tslint:disable:no-unused-expression\ncreateYargs()\n .command([\"build\", \"*\"], \"Build\", configureBuildCommand, wrap(build))\n .command(\"install-app-deps\", \"Install app deps\", configureInstallAppDepsCommand, wrap(installAppDeps))\n .command(\"node-gyp-rebuild\", \"Rebuild own native code\", configureInstallAppDepsCommand /* yes, args the same as for install app deps */, wrap(rebuildAppNativeCode))\n .command(\"create-self-signed-cert\", \"Create self-signed code signing cert for Windows apps\",\n yargs => yargs\n .option(\"publisher\", {\n alias: [\"p\"],\n type: \"string\",\n requiresArg: true,\n description: \"The publisher name\",\n })\n .demandOption(\"publisher\"),\n wrap(argv => createSelfSignedCert(argv.publisher)))\n .command(\"start\", \"Run application in a development mode using electron-webpack\",\n yargs => yargs,\n wrap(() => start()))\n .help()\n .epilog(`See ${chalk.underline(\"https://electron.build\")} for more documentation.`)\n .strict()\n .recommendCommands()\n .argv\n\nfunction wrap(task: (args: any) => Promise<any>) {\n return (args: any) => {\n checkIsOutdated()\n loadEnv(path.join(process.cwd(), \"electron-builder.env\"))\n .then(() => task(args))\n .catch(error => {\n process.exitCode = 1\n // https://github.com/electron-userland/electron-builder/issues/2940\n process.on(\"exit\", () => process.exitCode = 1)\n if (error instanceof InvalidConfigurationError) {\n log.error(null, error.message)\n }\n else if (!(error instanceof ExecError) || !error.alreadyLogged) {\n log.error({stackTrace: error.stack}, error.message)\n }\n })\n }\n}\n\nfunction checkIsOutdated() {\n if (isCi || process.env.NO_UPDATE_NOTIFIER != null) {\n return\n }\n\n readJson(path.join(__dirname, \"..\", \"..\", \"package.json\"))\n .then(it => {\n if (it.version === \"0.0.0-semantic-release\") {\n return\n }\n\n const notifier = updateNotifier({pkg: it})\n if (notifier.update != null) {\n notifier.notify({\n message: `Update available ${chalk.dim(notifier.update.current)}${chalk.reset(\" → \")}${chalk.green(notifier.update.latest)} \\nRun ${chalk.cyan(\"yarn upgrade electron-builder\")} to update`\n })\n }\n })\n .catch(e => log.warn({error: e}, \"cannot check updates\"))\n}\n\nasync function rebuildAppNativeCode(args: any) {\n const projectDir = process.cwd()\n log.info({platform: args.platform, arch: args.arch}, \"executing node-gyp rebuild\")\n // this script must be used only for electron\n await exec(process.platform === \"win32\" ? \"node-gyp.cmd\" : \"node-gyp\", [\"rebuild\"], {\n env: getGypEnv({version: await getElectronVersion(projectDir), useCustomDist: true}, args.platform, args.arch, true),\n })\n}"],"sourceRoot":""}
|