Skip to content

Instantly share code, notes, and snippets.

@JasonGhent
Last active November 3, 2016 14:31
Show Gist options
  • Save JasonGhent/56461a674011951881e5ee86e5d7f9b8 to your computer and use it in GitHub Desktop.
Save JasonGhent/56461a674011951881e5ee86e5d7f9b8 to your computer and use it in GitHub Desktop.
Ran Signal as a NW.js OSX app for a while, but NW.js broke this for newer versions. Not a fan of the 'native' Chrome app, so it was easier to just stop using the platform entirely. If this still works, it is invoked with `make signal.app`. More info about the NW.js breakage here: https://github.com/nwjs/nw.js/issues/5295
SDK_URL=http://dl.nwjs.io/v0.14.4/nwjs-sdk-v0.14.4-osx-x64.zip
export SDK_URL
APP_BIN=Signal.app
export APP_BIN
PROJECT=Signal-Desktop
export PROJECT
GIT_URL=https://github.com/WhisperSystems/${PROJECT}.git
export GIT_URL
fetch:
curl -OL $$SDK_URL
inflate:
unzip -o $$(node -e 'console.log(process.env.SDK_URL.split("/").pop().split(".").join("."))')
rm -rf $$APP_BIN
cp -r $$(node -e 'console.log(process.env.SDK_URL.split("/").pop().split(".").slice(0,-1).join("."))')/nwjs.app $$APP_BIN
clone:
if [ ! -d "$$PROJECT" ]; then git clone $$GIT_URL; fi;
cd $$PROJECT && git pull && npm install && node_modules/grunt-cli/bin/grunt
package:
cp -r $$PROJECT/dist $$APP_BIN/Contents/Resources/app.nw
build:
make fetch && make inflate && make clone && make package
install:
rm -rf /Applications/$$APP_BIN
mv $$APP_BIN /Applications/
signal.app:
make build && make install; /bin/bash -c "osascript -e 'display alert \"Task done!\"'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment