Skip to content

Commit

Permalink
Remove snap bs from build script, since snapcraft needs to be used
Browse files Browse the repository at this point in the history
  • Loading branch information
NeoTheThird committed Jul 1, 2018
1 parent e9e724c commit 9b67e47
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 21 deletions.
20 changes: 1 addition & 19 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,32 +44,16 @@ const setEvents = (downloadEvent) => {
});
}

function canBuildSnap() {
return fs.existsSync("/usr/bin/snapcraft") || fs.existsSync("/snap/bin/snapcraft")
}

function getLinuxTargets() {
if (cli.appimageOnly) {
return ["AppImage"];
} else if (cli.snapOnly) {
if (canBuildSnap()) {
return ["snap"];
} else {
console.log("Snapcraft is not installed. Aborting build...")
process.exit(1);
}
} else if (cli.buildToDir) {
return ["dir"];
} else if (cli.debOnly) {
return ["deb"];
}

var linuxTargets = [];
if (!cli.ignoreSnap && canBuildSnap()) {
linuxTargets.push("snap")
} else {
console.log("Cannot build snap, please install snapcraft (ignoring building of snap for now)")
}
if (!cli.ignoreDeb) {
linuxTargets.push("deb")
}
Expand Down Expand Up @@ -164,10 +148,8 @@ cli
.option('-w, --windows', 'Build for Windows')
.option('-m, --mac', 'Build for Mac')
.option('-d, --download-only', 'Only download platformTools')
.option('-s, --snap-only', "Build only snap")
.option('-e, --deb-only', "Build only snap")
.option('-e, --deb-only', "Build only deb")
.option('-a, --appimage-only', "Build only appimage")
.option('-r, --ignore-snap', "Do not build snap")
.option('-t, --ignore-deb', "Do not build deb")
.option('-y, --ignore-appimage', "Do not build appimage")
.option('-b, --build-to-dir', "Build only to dir")
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"scripts": {
"test-unit": "NODE_ENV=test mocha 'tests/unit-tests/*.js'",
"start": "electron .",
"dist:unix": "node ./build.js -lmr",
"dist:linux": "node ./build.js -lr",
"dist:unix": "node ./build.js -lm",
"dist:linux": "node ./build.js -l",
"dist:mac": "node ./build.js -m",
"dist:win": "node ./build.js -w"
},
Expand Down

0 comments on commit 9b67e47

Please sign in to comment.