1
0
mirror of https://github.com/rhysd/Mstdn.git synced 2025-01-20 19:52:10 +01:00
Mstdn/bin/cli.js
2017-04-15 14:06:14 +09:00

21 lines
589 B
JavaScript
Executable File

#! /usr/bin/env node
const child_process = require('child_process');
const path = require('path');
const electron = require('electron');
const args = [path.join(__dirname, '..')];
if (process.argv.indexOf('--version') >= 0) {
process.stdout.write(require('../package.json').version + '\n');
} else if (process.env.NODE_ENV === 'development' || process.argv.indexOf('--no-detach') !== -1) {
child_process.spawn(electron, args, {
stdio: 'inherit'
});
} else {
child_process.spawn(electron, args, {
stdio: 'ignore',
detached: true
}).unref();
}