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D,KADH,CACS,4BADT;AAED,C","sourcesContent":["#! /usr/bin/env node\n\nimport { log, use, getArchCliNames } from \"builder-util\"\nimport { printErrorAndExit } from \"builder-util/out/promise\"\nimport { computeDefaultAppDirectory, getConfig } from \"app-builder-lib/out/util/config\"\nimport { getElectronVersion } from \"app-builder-lib/out/electron/electronVersion\"\nimport { createLazyProductionDeps } from \"app-builder-lib/out/util/packageDependencies\"\nimport { installOrRebuild } from \"app-builder-lib/out/util/yarn\"\nimport { readJson } from \"fs-extra\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport { orNullIfFileNotExist } from \"read-config-file\"\nimport yargs from \"yargs\"\n\ndeclare const PACKAGE_VERSION: string\n\n/** @internal */\nexport function configureInstallAppDepsCommand(yargs: yargs.Argv): yargs.Argv {\n // https://github.com/yargs/yargs/issues/760\n // demandOption is required to be set\n return yargs\n .parserConfiguration({\n \"camel-case-expansion\": false,\n })\n .option(\"platform\", {\n choices: [\"linux\", \"darwin\", \"win32\"],\n default: process.platform,\n description: \"The target platform\",\n })\n .option(\"arch\", {\n choices: getArchCliNames().concat(\"all\"),\n default: process.arch === \"arm\" ? \"armv7l\" : process.arch,\n description: \"The target arch\",\n })\n}\n\n/** @internal */\nexport async function installAppDeps(args: any) {\n try {\n log.info({version: PACKAGE_VERSION}, \"electron-builder\")\n }\n catch (e) {\n // error in dev mode without babel\n if (!(e instanceof ReferenceError)) {\n throw e\n }\n }\n\n const projectDir = process.cwd()\n const packageMetadata = new Lazy(() => orNullIfFileNotExist(readJson(path.join(projectDir, \"package.json\"))))\n const config = await getConfig(projectDir, null, null, packageMetadata)\n const results = await Promise.all<string>([\n computeDefaultAppDirectory(projectDir, use(config.directories, it => it!.app)),\n getElectronVersion(projectDir, config, packageMetadata),\n ])\n\n // if two package.json — force full install (user wants to install/update app deps in addition to dev)\n await installOrRebuild(config, results[0], {\n frameworkInfo: {version: results[1], useCustomDist: true},\n platform: args.platform,\n arch: args.arch,\n productionDeps: createLazyProductionDeps(results[0], null),\n }, results[0] !== projectDir)\n}\n\nfunction main() {\n return installAppDeps(configureInstallAppDepsCommand(yargs).argv)\n}\n\nif (process.mainModule === module) {\n log.warn(\"please use as subcommand: electron-builder install-app-deps\")\n main()\n .catch(printErrorAndExit)\n}"],"sourceRoot":""}
|