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D;AACF;;AACD,SAAO,QAAP;AACD,C","sourcesContent":["export enum Arch {\n ia32, x64, armv7l, arm64\n}\n\nexport type ArchType = \"x64\" | \"ia32\" | \"armv7l\" | \"arm64\"\n\nexport function toLinuxArchString(arch: Arch, targetName: string): string {\n switch (arch) {\n case Arch.x64:\n return \"amd64\"\n case Arch.ia32:\n return targetName === \"pacman\" ? \"i686\" : \"i386\"\n case Arch.armv7l:\n return targetName === \"snap\" || targetName === \"deb\" ? \"armhf\" : \"armv7l\"\n case Arch.arm64:\n return \"arm64\"\n\n default:\n throw new Error(`Unsupported arch ${arch}`)\n }\n}\n\nexport function getArchCliNames(): Array {\n return [Arch[Arch.ia32], Arch[Arch.x64], Arch[Arch.armv7l], Arch[Arch.arm64]]\n}\n\nexport function getArchSuffix(arch: Arch): string {\n return arch === Arch.x64 ? \"\" : `-${Arch[arch]}`\n}\n\nexport function archFromString(name: string): Arch {\n switch (name) {\n case \"x64\":\n return Arch.x64\n case \"ia32\":\n return Arch.ia32\n case \"arm64\":\n return Arch.arm64\n case \"armv7l\":\n return Arch.armv7l\n\n default:\n throw new Error(`Unsupported arch ${name}`)\n }\n}\n\nexport function getArtifactArchName(arch: Arch, ext: string): string {\n let archName = Arch[arch]\n const isAppImage = ext === \"AppImage\" || ext === \"appimage\"\n if (arch === Arch.x64) {\n if (isAppImage || ext === \"rpm\") {\n archName = \"x86_64\"\n }\n else if (ext === \"deb\" || ext === \"snap\") {\n archName = \"amd64\"\n }\n }\n else if (arch === Arch.ia32) {\n if (ext === \"deb\" || isAppImage || ext === \"snap\") {\n archName = \"i386\"\n }\n else if (ext === \"pacman\" || ext === \"rpm\") {\n archName = \"i686\"\n }\n }\n else if (arch === Arch.armv7l) {\n if (ext === \"snap\") {\n archName = \"armhf\"\n }\n }\n return archName\n}"],"sourceRoot":""}