Skip to content

Commit

Permalink
Always extend npm install
Browse files Browse the repository at this point in the history
* Since we've switched to a VPS this test is no longer needed and will help keep production up to date.

Post OpenUserJS#425 fix
  • Loading branch information
Martii committed Jul 8, 2015
1 parent fba5af6 commit 7a5af38
Showing 1 changed file with 86 additions and 89 deletions.
175 changes: 86 additions & 89 deletions dev/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,121 +9,101 @@ var isDbg = require('../libs/debug').isDbg;
var exec = require('child_process').exec;
var async = require('async');

if (isDev || isDbg) {
var tasks = [];
var no = {};

var tasks = [];
var no = {};
tasks.push(function (aCallback) {
var cmd = 'node -v';
console.log('>> ' + cmd);

tasks.push(function (aCallback) {
var cmd = 'node -v';
console.log('>> ' + cmd);
exec(cmd, function (aErr, aStdout, aStderr) {
if (aErr) {
console.error(aStderr);
} else {
console.log(aStdout);
}

exec(cmd, function (aErr, aStdout, aStderr) {
if (aErr) {
console.error(aStderr);
} else {
console.log(aStdout);
}
aCallback();
});
});

aCallback();
});
tasks.push(function (aCallback) {
var cmd = 'npm -v';
console.log('>> ' + cmd);

exec(cmd, function (aErr, aStdout, aStderr) {
if (aErr) {
console.error(aStderr);
} else {
console.log(aStdout);
}

aCallback();
});
});

tasks.push(function (aCallback) {
var cmd = 'ruby -v';
console.log('>> ' + cmd);

exec(cmd, function (aErr, aStdout, aStderr) {
if (aErr) {
no.ruby = true;
console.error(aStderr);
} else {
console.log(aStdout);
}

aCallback();
});
});

tasks.push(function (aCallback) {
var cmd = 'bundler -v';

tasks.push(function (aCallback) {
var cmd = 'npm -v';
if (!no.ruby) {
console.log('>> ' + cmd);

exec(cmd, function (aErr, aStdout, aStderr) {
if (aErr) {
no.bundler = true;
console.error(aStderr);
} else {
console.log(aStdout);
}

aCallback();
});
});
} else {
aCallback();
}
});

tasks.push(function (aCallback) {
var cmd = 'bundler outdated';

tasks.push(function (aCallback) {
var cmd = 'ruby -v';
if (!no.bundler) {
console.log('>> ' + cmd);

exec(cmd, function (aErr, aStdout, aStderr) {
if (aErr) {
no.ruby = true;
no.bundle = true;
console.error(aStderr);
} else {
console.log(aStdout);
}

aCallback();
});
});
} else {
aCallback();
}
});

tasks.push(function (aCallback) {
var cmd = 'bundler -v';
tasks.push(function (aCallback) {
var cmd = 'bundler install';

if (!no.ruby) {
console.log('>> ' + cmd);

exec(cmd, function (aErr, aStdout, aStderr) {
if (aErr) {
no.bundler = true;
console.error(aStderr);
} else {
console.log(aStdout);
}

aCallback();
});
} else {
aCallback();
}
});

tasks.push(function (aCallback) {
var cmd = 'bundler outdated';

if (!no.bundler) {
console.log('>> ' + cmd);

exec(cmd, function (aErr, aStdout, aStderr) {
if (aErr) {
no.bundle = true;
console.error(aStderr);
} else {
console.log(aStdout);
}

aCallback();
});
} else {
aCallback();
}
});

tasks.push(function (aCallback) {
var cmd = 'bundler install';

if (no.bundle) {
console.log('>> ' + cmd);

exec(cmd, function (aErr, aStdout, aStderr) {
if (aErr) {
console.error(aStderr);
} else {
console.log(aStdout);
}

aCallback();
});
} else {
aCallback();
}
});

tasks.push(function (aCallback) {
var cmd = 'npm --depth 0 outdated';
if (no.bundle) {
console.log('>> ' + cmd);

exec(cmd, function (aErr, aStdout, aStderr) {
Expand All @@ -135,13 +115,30 @@ if (isDev || isDbg) {

aCallback();
});
});
} else {
aCallback();
}
});

tasks.push(function (aCallback) {
var cmd = 'npm --depth 0 outdated';
console.log('>> ' + cmd);

async.series(tasks, function (aErr) {
exec(cmd, function (aErr, aStdout, aStderr) {
if (aErr) {
console.error('There was an unexpected error.');
console.error(aStderr);
} else {
console.log(aStdout);
}

console.log('>\n');
aCallback();
});
}
});

async.series(tasks, function (aErr) {
if (aErr) {
console.error('There was an unexpected error.');
}

console.log('>\n');
});

0 comments on commit 7a5af38

Please sign in to comment.