Skip to content

Commit

Permalink
fix(linux): fix command forever to work in linux
Browse files Browse the repository at this point in the history
  • Loading branch information
gerard2perez committed Nov 24, 2016
1 parent 8ed4b70 commit 4ce763e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ globals:
__ok: true
__nok: true
skipshell: true
cleanString: true
env:
amd: true
browser: false
Expand Down
2 changes: 1 addition & 1 deletion src/commands/forever.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import command from '../command';

const list = async function list() {
let data = await utils.exec(`forever list`, {});
data = data.stdout.replace("info: Forever processes running", "").replace(/ /igm, "-").replace(/data:/igm, "");
data = cleanString(data.stdout).replace("info: Forever processes running", "").replace(/ /igm, "-").replace(/data:/igm, "");
let fix = (new RegExp(/"[^"]*"/igm)).exec(data);
if (fix !== null) {
fix.forEach(function(pattern) {
Expand Down
3 changes: 1 addition & 2 deletions test/configuration/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ tests.push(new TestNode('(no args)', [undefined, {}], true))
process.chdir('testingapp');
process.env.isproyect = 'true';
global.scfg = new ServerConfiguaration();


global.skipshell = true;
});

tests.last.CleanUp(() => {
Expand Down
11 changes: 7 additions & 4 deletions test/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ const testcase = function testcase(test_config, cwd, testname, command) {
co(function*() {
let err = null;
const ori = console.log;
const write = process.stdout.write;
const write_e = process.stderr.write;
const write_o = process.stdout.write;
try {
let buffer = "";
process.stderr.write=()=>{};
process.stderr.write = () => {};
process.stdout.write = () => {};
console.log = (data) => {
// ori(data);
buffer += (data || "").toString();
Expand All @@ -43,12 +45,13 @@ const testcase = function testcase(test_config, cwd, testname, command) {
assert.equal(actual, mustbe, message);
}
} catch (e) {
console.log(e.red);
ori(e.red);
err = e;
} finally {
testdata.CleanUp();
console.log = ori;
process.stderr.write = write;
process.stderr.write = write_e;
process.stdout.write = write_o;
}
if (err) {
throw err;
Expand Down

0 comments on commit 4ce763e

Please sign in to comment.