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\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport { Target } from \"../core\"\nimport { LinuxPackager } from \"../linuxPackager\"\nimport { AppImageOptions } from \"../options/linuxOptions\"\nimport { getAppUpdatePublishConfiguration } from \"../publish/PublishManager\"\nimport { executeAppBuilderAsJson, objectToArgs } from \"../util/appBuilder\"\nimport { getNotLocalizedLicenseFile } from \"../util/license\"\nimport { LinuxTargetHelper } from \"./LinuxTargetHelper\"\nimport { createStageDir } from \"./targetUtil\"\n\n// https://unix.stackexchange.com/questions/375191/append-to-sub-directory-inside-squashfs-file\nexport default class AppImageTarget extends Target {\n readonly options: AppImageOptions = { ...this.packager.platformSpecificBuildOptions, ...(this.packager.config as any)[this.name] }\n private readonly desktopEntry: Lazy<string>\n\n constructor(ignored: string, private readonly packager: LinuxPackager, private readonly helper: LinuxTargetHelper, readonly outDir: string) {\n super(\"appImage\")\n\n this.desktopEntry = new Lazy<string>(() => {\n const args = this.options.executableArgs?.join(\" \") || \"--no-sandbox\"\n return helper.computeDesktopEntry(this.options, `AppRun ${args} %U`, {\n \"X-AppImage-Version\": `${packager.appInfo.buildVersion}`,\n })\n })\n }\n\n async build(appOutDir: string, arch: Arch): Promise<any> {\n const packager = this.packager\n const options = this.options\n // https://github.com/electron-userland/electron-builder/issues/775\n // https://github.com/electron-userland/electron-builder/issues/1726\n // tslint:disable-next-line:no-invalid-template-strings\n const artifactName = packager.expandArtifactNamePattern(options, \"AppImage\", arch)\n const artifactPath = path.join(this.outDir, artifactName)\n await packager.info.callArtifactBuildStarted({\n targetPresentableName: \"AppImage\",\n file: artifactPath,\n arch,\n })\n\n const c = await Promise.all([\n this.desktopEntry.value,\n this.helper.icons,\n getAppUpdatePublishConfiguration(packager, arch, false /* in any case validation will be done on publish */),\n getNotLocalizedLicenseFile(options.license, this.packager, [\"txt\", \"html\"]),\n createStageDir(this, packager, arch),\n ])\n const license = c[3]\n const stageDir = c[4]!\n\n const publishConfig = c[2]\n if (publishConfig != null) {\n await outputFile(path.join(packager.getResourcesDir(stageDir.dir), \"app-update.yml\"), serializeToYaml(publishConfig))\n }\n\n if (\n this.packager.packagerOptions.effectiveOptionComputed != null &&\n (await this.packager.packagerOptions.effectiveOptionComputed({ desktop: await this.desktopEntry.value }))\n ) {\n return\n }\n\n const args = [\n \"appimage\",\n \"--stage\",\n stageDir.dir,\n \"--arch\",\n Arch[arch],\n \"--output\",\n artifactPath,\n \"--app\",\n appOutDir,\n \"--configuration\",\n JSON.stringify({\n productName: this.packager.appInfo.productName,\n productFilename: this.packager.appInfo.productFilename,\n desktopEntry: c[0],\n executableName: this.packager.executableName,\n icons: c[1],\n fileAssociations: this.packager.fileAssociations,\n ...options,\n }),\n ]\n objectToArgs(args, {\n license,\n })\n if (packager.compression === \"maximum\") {\n args.push(\"--compression\", \"xz\")\n }\n\n await packager.info.callArtifactBuildCompleted({\n file: artifactPath,\n safeArtifactName: packager.computeSafeArtifactName(artifactName, \"AppImage\", arch, false),\n target: this,\n arch,\n packager,\n isWriteUpdateInfo: true,\n updateInfo: await executeAppBuilderAsJson(args),\n })\n }\n}\n"]}