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CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC,CAAA;IAC5E,IAAI,GAAG,CAAC,OAAO,KAAK,wBAAwB,EAAE;QAC5C,OAAM;KACP;IACD,MAAM,cAAc,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAA;IACxD,MAAM,cAAc,CAAC,EAAE,GAAG,EAAE,CAAC,CAAA;AAC/B,CAAC;AAED,KAAK,UAAU,oBAAoB,CAAC,IAAS;IAC3C,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE,CAAA;IAChC,6CAA6C;IAC7C,OAAO,IAAA,qBAAc,EAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,IAAA,oCAAkB,EAAC,UAAU,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAA;AACzH,CAAC","sourcesContent":["#! /usr/bin/env node\n\nimport { InvalidConfigurationError, log } from \"builder-util\"\nimport * as chalk from \"chalk\"\nimport { readJson } from \"fs-extra\"\nimport * as isCi from \"is-ci\"\nimport * as path from \"path\"\nimport { loadEnv } from \"read-config-file\"\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\"\nimport { nodeGypRebuild } from \"app-builder-lib/out/util/yarn\"\nimport { getElectronVersion } from \"app-builder-lib/out/electron/electronVersion\"\n\n// tslint:disable:no-unused-expression\nvoid createYargs()\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(\n \"create-self-signed-cert\",\n \"Create self-signed code signing cert for Windows apps\",\n yargs =>\n 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 )\n .command(\n \"start\",\n \"Run application in a development mode using electron-webpack\",\n yargs => yargs,\n wrap(() => start())\n )\n .help()\n .epilog(`See ${chalk.underline(\"https://electron.build\")} for more documentation.`)\n .strict()\n .recommendCommands().argv\n\nfunction wrap(task: (args: any) => Promise<any>) {\n return (args: any) => {\n checkIsOutdated().catch((e: any) => log.warn({ error: e }, \"cannot check updates\"))\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 } else if (!(error instanceof ExecError) || !error.alreadyLogged) {\n log.error({ failedTask: task.name, stackTrace: error.stack }, error.message)\n }\n })\n }\n}\n\nasync function checkIsOutdated() {\n if (isCi || process.env.NO_UPDATE_NOTIFIER != null) {\n return\n }\n\n const pkg = await readJson(path.join(__dirname, \"..\", \"..\", \"package.json\"))\n if (pkg.version === \"0.0.0-semantic-release\") {\n return\n }\n const UpdateNotifier = require(\"simple-update-notifier\")\n await UpdateNotifier({ pkg })\n}\n\nasync function rebuildAppNativeCode(args: any) {\n const projectDir = process.cwd()\n // this script must be used only for electron\n return nodeGypRebuild(args.platform, args.arch, { version: await getElectronVersion(projectDir), useCustomDist: true })\n}\n"]}