Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

Commit

Permalink
Revert magnet cli spawn implementation (#82)
Browse files Browse the repository at this point in the history
* Revert magnet cli spawn implementation

* Removes spaces
  • Loading branch information
pragmaticivan authored and eduardolundgren committed Apr 27, 2017
1 parent eda81bd commit 1c06024
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"chokidar": "^1.6.1",
"cli-table": "^0.3.1",
"compression": "^1.6.2",
"cross-spawn": "^5.0.1",
"express": "^4.13.0",
"express-validator": "^3.1.2",
"fs-extra": "^2.0.0",
Expand Down
7 changes: 3 additions & 4 deletions src/bin/magnet
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env node

import {join} from 'path';
import {spawn} from 'cross-spawn';
import chokidar from 'chokidar';
import childProcess from 'child_process';
import log from '../log';
import pkg from '../../package.json';

Expand Down Expand Up @@ -47,8 +47,7 @@ if (commands.has(cmd)) {
const bin = join(__dirname, 'magnet-' + cmd);

const startProcess = () => {
const proc = childProcess.spawn(
bin, args, {stdio: 'inherit', customFds: [0, 1, 2]});
const proc = spawn(bin, args, {stdio: 'inherit', customFds: [0, 1, 2]});
proc.on('close', (code, signal) => {
if (code !== null) {
process.exit(code);
Expand Down Expand Up @@ -82,7 +81,7 @@ if (cmd === 'dev') {
let restart = () => {
log.info(false, 'Found a change, restarting the server…');
proc.removeAllListeners('close');
process.kill(proc.pid, 'SIGTERM');
proc.kill();
proc = startProcess();
};

Expand Down

0 comments on commit 1c06024

Please sign in to comment.