UNPKG

2.55 kBSource Map (JSON)View Raw
1{"version":3,"sources":["../../src/targets/targetUtil.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAGM,MAAA,QAAA,CAAA;AACJ,cAAqB,GAArB,EAAgC;AAAX,SAAA,GAAA,GAAA,GAAA;AACpB;;AAED,cAAY,IAAZ,EAAwB;AACtB,WAAO,KAAK,GAAL,GAAW,KAAK,GAAhB,GAAsB,IAA7B;AACD;;AAED,YAAO;AACL,QAAI,CAAC,qBAAM,OAAP,IAAkB,QAAQ,GAAR,CAAY,2CAAZ,KAA4D,MAAlF,EAA0F;AACxF,aAAO,wBAAO,KAAK,GAAZ,CAAP;AACD;;AACD,WAAO,QAAQ,OAAR,EAAP;AACD;;AAED,aAAQ;AACN,WAAO,KAAK,GAAZ;AACD;;AAjBG;;;;;2CAoBC,WAA8B,MAA9B,EAA8C,QAA9C,EAA+E,IAA/E,EAAyF;AAC9F,WAAO,IAAI,QAAJ,EAAa,MAAM,mBAAmB,MAAnB,EAA2B,QAA3B,EAAqC,IAArC,CAAnB,EAAP;AACD,G;;kBAFW,c;;;;;;;;4CAIL,WAAkC,MAAlC,EAAkD,QAAlD,EAAmF,IAAnF,EAA6F;AAClG,UAAM,UAAU,SAAS,IAAT,CAAc,sBAAd,CAAqC,MAArC,EAA6C,QAA7C,EAAuD,IAAvD,CAAhB;AACA,UAAM,0BAAS,OAAT,CAAN;AACA,WAAO,OAAP;AACD,G;;kBAJW,kB;;;MAMZ;AACA;;;;;AACM,SAAA,6BAAA,CAAwC,OAAxC,EAA0D,qBAA1D,EAAwF;AAC5F,SAAO,yBAAyB,sBAAsB,IAAtB,CAA2B,QAAQ,eAAnC,CAAzB,GAA+E,QAAQ,eAAvF,GAAyG,QAAQ,aAAxH;AACD,C","sourcesContent":["import { emptyDir, remove } from \"fs-extra-p\"\nimport * as path from \"path\"\nimport { Target, AppInfo } from \"../\"\nimport { Arch, debug } from \"builder-util\"\nimport { PlatformPackager } from \"../platformPackager\"\n\nexport class StageDir {\n constructor(readonly dir: string) {\n }\n\n getTempFile(name: string) {\n return this.dir + path.sep + name\n }\n\n cleanup() {\n if (!debug.enabled || process.env.ELECTRON_BUILDER_REMOVE_STAGE_EVEN_IF_DEBUG === \"true\") {\n return remove(this.dir)\n }\n return Promise.resolve()\n }\n\n toString() {\n return this.dir\n }\n}\n\nexport async function createStageDir(target: Target, packager: PlatformPackager<any>, arch: Arch): Promise<StageDir> {\n return new StageDir(await createStageDirPath(target, packager, arch))\n}\n\nexport async function createStageDirPath(target: Target, packager: PlatformPackager<any>, arch: Arch): Promise<string> {\n const tempDir = packager.info.stageDirPathCustomizer(target, packager, arch)\n await emptyDir(tempDir)\n return tempDir\n}\n\n// https://github.com/electron-userland/electron-builder/issues/3100\n// https://github.com/electron-userland/electron-builder/commit/2539cfba20dc639128e75c5b786651b652bb4b78\nexport function getWindowsInstallationDirName(appInfo: AppInfo, isTryToUseProductName: boolean): string {\n return isTryToUseProductName && /^[-_+0-9a-zA-Z .]+$/.test(appInfo.productFilename) ? appInfo.productFilename : appInfo.sanitizedName\n}"],"sourceRoot":""}