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M,EAAlD,EAAsD,YAAtD,EAAoE,IAApE;;AACA,UAAI,OAAO,UAAP,CAAkB,MAAlB,CAAJ,EAA+B;AAC7B,cAAM,oBAAI,SAAS,WAAb,EAA0B,MAA1B,EAAkC,YAAlC,EAAgD,SAAhD,EAA2D,KAA3D,EAAkE,SAAS,IAAT,CAAc,cAAhF,CAAN;AACD,OAFD,MAGK;AACH,cAAM,wBAAQ,MAAR,EAAgB,YAAhB,EAA8B,SAA9B,EAAyC;AAC7C,uBAAa,SAAS,WADuB;AAE7C,sBAAY,CAAC;AAFgC,SAAzC,CAAN;AAID;;AAED,eAAS,IAAT,CAAc,uBAAd,CAAsC;AACpC,cAAM,YAD8B;AAEpC;AACA,0BAAkB,SAAS,uBAAT,CAAiC,YAAjC,EAA+C,MAA/C,EAAuD,IAAvD,EAA6D,KAA7D,EAAoE,eAAe,OAAf,CAAuB,gBAAvB,EAAyC,SAAzC,CAApE,CAHkB;AAIpC,gBAAQ,KAJ4B;AAKpC,YALoC;AAMpC,gBANoC;AAOpC,2BAAmB,MAAK;AAPY,OAAtC;AA7BuC;AAsCxC;;AA7CsC,C","sourcesContent":["import { Arch } from \"builder-util\"\nimport * as path from \"path\"\nimport { Platform, Target, TargetSpecificOptions } from \"../core\"\nimport { PlatformPackager } from \"../platformPackager\"\nimport { archive, tar } from \"./archive\"\n\nexport class ArchiveTarget extends Target {\n readonly options: TargetSpecificOptions = (this.packager.config as any)[this.name]\n\n constructor(name: string, readonly outDir: string, private readonly packager: PlatformPackager<any>, private readonly isWriteUpdateInfo = false) {\n super(name)\n }\n\n async build(appOutDir: string, arch: Arch): Promise<any> {\n const packager = this.packager\n const isMac = packager.platform === Platform.MAC\n const format = this.name\n\n let defaultPattern: string\n if (packager.platform === Platform.LINUX) {\n // tslint:disable-next-line:no-invalid-template-strings\n defaultPattern = \"${name}-${version}\" + (arch === Arch.x64 ? \"\" : \"-${arch}\") + \".${ext}\"\n }\n else {\n // tslint:disable-next-line:no-invalid-template-strings\n defaultPattern = \"${productName}-${version}\" + (arch === Arch.x64 ? \"\" : \"-${arch}\") + \"-${os}.${ext}\"\n }\n\n const artifactName = packager.expandArtifactNamePattern(this.options, format, arch, defaultPattern, false)\n const artifactPath = path.join(this.outDir, artifactName)\n\n this.logBuilding(`${isMac ? \"macOS \" : \"\"}${format}`, artifactPath, arch)\n if (format.startsWith(\"tar.\")) {\n await tar(packager.compression, format, artifactPath, appOutDir, isMac, packager.info.tempDirManager)\n }\n else {\n await archive(format, artifactPath, appOutDir, {\n compression: packager.compression,\n withoutDir: !isMac,\n })\n }\n\n packager.info.dispatchArtifactCreated({\n file: artifactPath,\n // tslint:disable-next-line:no-invalid-template-strings\n safeArtifactName: packager.computeSafeArtifactName(artifactName, format, arch, false, defaultPattern.replace(\"${productName}\", \"${name}\")),\n target: this,\n arch,\n packager,\n isWriteUpdateInfo: this.isWriteUpdateInfo,\n })\n }\n}"],"sourceRoot":""}
|