diff --git a/script/electron-builder-linux.yml b/script/electron-builder-linux.yml index a638a0bb96d..94067f6121f 100644 --- a/script/electron-builder-linux.yml +++ b/script/electron-builder-linux.yml @@ -9,7 +9,6 @@ linux: target: - deb - rpm - - snap - AppImage maintainer: 'GitHub, Inc ' deb: diff --git a/script/package.ts b/script/package.ts index 9586b6669a3..b7c34acfd45 100644 --- a/script/package.ts +++ b/script/package.ts @@ -6,10 +6,8 @@ import * as path from 'path' import * as crypto from 'crypto' import * as electronInstaller from 'electron-winstaller' import * as glob from 'glob' -import * as YAML from 'yaml' -const rimraf = require('rimraf') -import { getProductName, getCompanyName, getVersion } from '../app/package-info' +import { getProductName, getCompanyName } from '../app/package-info' import { getDistPath, getDistRoot, @@ -148,54 +146,6 @@ function getSha256Checksum(fullPath: string): Promise { }) } -function throwIfError(command: string, args: string[]) { - const { error } = cp.spawnSync(command, args, { stdio: 'inherit' }) - - if (error != null) { - throw error - } -} - -function workaroundForSnapPackage() { - const distRoot = getDistRoot() - - const snapArchive = path.join( - distRoot, - `GitHubDesktop-linux-${getVersion()}.snap` - ) - const snapFileSystem = path.join(distRoot, 'unsquashfs-root') - - throwIfError('unsquashfs', [ - '-dest', - snapFileSystem, - '-no-progress', - snapArchive, - ]) - - const snapMetaYaml = path.join(snapFileSystem, 'meta', 'snap.yaml') - - const yamlText = fs.readFileSync(snapMetaYaml, 'utf8') - const yaml = YAML.parse(yamlText) - - // regenerate the YAML without whatever electron-builder has included for the plugs - // element, because a package using the strict enclosure should not define this - const yamlWithoutPlugs = { - ...yaml, - apps: { - 'github-desktop': { - command: 'command.sh', - }, - }, - } - - const newYaml = YAML.stringify(yamlWithoutPlugs) - fs.writeFileSync(snapMetaYaml, newYaml, 'utf8') - - throwIfError('snapcraft', ['pack', snapFileSystem, '--output', snapArchive]) - - rimraf.sync(snapFileSystem) -} - function generateChecksums() { const distRoot = getDistRoot() @@ -252,7 +202,5 @@ function packageLinux() { throw error } - workaroundForSnapPackage() - generateChecksums() }