stlive
Version:
Live edit your JS/HTML/CSS source code in Sencha Touch / PhoneGap projects. Autosync changes to multiple mobile devices of mixed OS types. Massively speed up your mobile app development by avoiding most compiling and redeployment.
21 lines (16 loc) • 547 B
JavaScript
require('terminal-colors');
var shell = require('shelljs');
var path = require('path');
var homedir = process.env[(process.platform == 'win32') ? 'USERPROFILE' : 'HOME'];
module.exports = {
expandHome: function(fileName) {
if (!fileName) return fileName;
if (fileName == '~') return homedir;
if (fileName.slice(0, 2) != '~/') return fileName;
return path.join(homedir, fileName.slice(2));
},
runcmd: function(cmd) {
console.log(cmd.lightYellow);
shell.exec(cmd);
}
};