Skip to content

Instantly share code, notes, and snippets.

@sbruchmann
Last active August 29, 2015 14:03
Show Gist options
  • Save sbruchmann/772576023528f57a58e4 to your computer and use it in GitHub Desktop.
Save sbruchmann/772576023528f57a58e4 to your computer and use it in GitHub Desktop.
Restart a node-webkit app
//Restart node-webkit app
var child_process = require("child_process");
//Start new app
var child = child_process.spawn(process.execPath, [], {detached: true});
//Don't wait for it
child.unref();
//Quit current
GUI.window.hide(); // hide window to prevent black display
GUI.app.quit(); // quit node-webkit app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment