From 5a0ed13ad913ec03db7b7381be92c4de43b0af7a Mon Sep 17 00:00:00 2001 From: Brendan Forster Date: Tue, 4 Feb 2020 17:46:53 -0400 Subject: [PATCH] drop snapcraft build until we can confirm resolution (#203) * drop snapcraft build until we can confirm resolution * remove workaround in package step --- script/electron-builder-linux.yml | 1 - script/package.ts | 54 +------------------------------ 2 files changed, 1 insertion(+), 54 deletions(-) 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() }