diff --git a/browser/main.js b/browser/main.js index 5e86638a0b..8c31209cdd 100644 --- a/browser/main.js +++ b/browser/main.js @@ -10,6 +10,8 @@ var app = require('app'); var BrowserWindow = require('browser-window'); var ipc = require('ipc'); +var argv = require('minimist')(process.argv); + process.env.NODE_PATH = __dirname + '/../node_modules'; process.chdir(path.join(__dirname, '..')); @@ -32,7 +34,11 @@ app.on('ready', function() { mainWindow = new BrowserWindow(windowOptions); mainWindow.hide(); - mainWindow.loadUrl('file://' + __dirname + '/../build/index.html'); + if (argv.test) { + mainWindow.loadUrl('file://' + __dirname + '/../specs/specs.html'); + } else { + mainWindow.loadUrl('file://' + __dirname + '/../build/index.html'); + } process.on('uncaughtException', app.quit); @@ -48,44 +54,45 @@ app.on('ready', function() { }); mainWindow.webContents.on('did-finish-load', function() { - mainWindow.show(); + mainWindow.show(); mainWindow.focus(); - mainWindow.setTitle(''); // Auto Updates - autoUpdater.setFeedUrl('https://updates.kitematic.com/releases/latest?version=' + app.getVersion()); + if (process.env.NODE_ENV !== 'development' && !argv.test) { + autoUpdater.setFeedUrl('https://updates.kitematic.com/releases/latest?version=' + app.getVersion()); - autoUpdater.on('checking-for-update', function (e) { - console.log('Checking for update...'); - }); + autoUpdater.on('checking-for-update', function (e) { + console.log('Checking for update...'); + }); - autoUpdater.on('update-available', function (e) { - console.log('Update available.'); - console.log(e); - }); + autoUpdater.on('update-available', function (e) { + console.log('Update available.'); + console.log(e); + }); - autoUpdater.on('update-not-available', function (e) { - console.log('Update not available.'); - }); + autoUpdater.on('update-not-available', function (e) { + console.log('Update not available.'); + }); - autoUpdater.on('update-downloaded', function (e, releaseNotes, releaseName, releaseDate, updateURL) { - console.log('Update downloaded.'); - mainWindow.webContents.send('notify', 'window:update-available'); - }); + autoUpdater.on('update-downloaded', function (e, releaseNotes, releaseName, releaseDate, updateURL) { + console.log('Update downloaded.'); + mainWindow.webContents.send('notify', 'window:update-available'); + }); - autoUpdater.on('error', function (e) { - console.log('An error occured while checking for updates.'); - console.log(e); - }); + autoUpdater.on('error', function (e) { + console.log('An error occured while checking for updates.'); + console.log(e); + }); - ipc.on('command', function (event, arg) { - console.log('Command: ' + arg); - if (arg === 'application:quit-install') { - saveVMOnQuit = false; - autoUpdater.quitAndInstall(); - } - }); + ipc.on('command', function (event, arg) { + console.log('Command: ' + arg); + if (arg === 'application:quit-install') { + saveVMOnQuit = false; + autoUpdater.quitAndInstall(); + } + }); + } ipc.on('vm', function (event, arg) { saveVMOnQuit = arg; diff --git a/deps b/deps index 31d4569aa9..e01dfa4f77 100755 --- a/deps +++ b/deps @@ -1,17 +1,25 @@ #!/bin/bash BASE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +PLATFORM='unknown' +unamestr=`uname` +if [[ "$unamestr" == 'Linux' ]]; then + PLATFORM='linux' +elif [[ "$unamestr" == 'Darwin' ]]; then + PLATFORM='darwin' +fi + export BOOT2DOCKER_CLI_VERSION=$(node -pe "JSON.parse(process.argv[1])['boot2docker-version']" "$(cat $BASE/package.json)") export BOOT2DOCKER_CLI_VERSION_FILE=boot2docker-$BOOT2DOCKER_CLI_VERSION export ATOM_SHELL_VERSION=$(node -pe "JSON.parse(process.argv[1])['atom-shell-version']" "$(cat $BASE/package.json)") -export ATOM_SHELL_VERSION_FILE=atom-shell-v$ATOM_SHELL_VERSION-darwin-x64.zip +export ATOM_SHELL_VERSION_FILE=atom-shell-v$ATOM_SHELL_VERSION-$PLATFORM-x64.zip -mkdir -p $BASE/cache -pushd $BASE/cache > /dev/null +mkdir -p $BASE/cache/$PLATFORM +pushd $BASE/cache/$PLATFORM > /dev/null if [ ! -f $ATOM_SHELL_VERSION_FILE ]; then echo "-----> Downloading atom-shell..." rm -rf atom-shell-* - curl -L -o $ATOM_SHELL_VERSION_FILE https://github.com/atom/atom-shell/releases/download/v$ATOM_SHELL_VERSION/atom-shell-v$ATOM_SHELL_VERSION-darwin-x64.zip + curl -L -o $ATOM_SHELL_VERSION_FILE https://github.com/atom/atom-shell/releases/download/v$ATOM_SHELL_VERSION/atom-shell-v$ATOM_SHELL_VERSION-$PLATFORM-x64.zip unzip $ATOM_SHELL_VERSION_FILE fi popd > /dev/null diff --git a/index.html b/index.html index 94d57f9b1e..86d233b8db 100644 --- a/index.html +++ b/index.html @@ -7,6 +7,5 @@
-