modi-cli
Version:
Console application for provisioning, displaying or destroying virtual machines in MODI
47 lines (29 loc) • 981 B
JavaScript
var fs = require('fs');
var osversion = process.platform;
var homePath;
var modiSettingsPath = '.modisettings';
var modiCommandPath = '';
switch(osversion) {
case 'win32':
homePath = process.env.USERPROFILE;
modiSettingsPath = homePath + '\\.modisettings';
modiCommandPath = homePath + '\\modi.bat';
break;
case 'linux':
homePath = process.env.HOME;
modiSettingsPath = homePath + '/.modisettings';
modiCommandPath = homePath + '/modi';
break;
case 'darwin':
homePath = process.env.HOME;
modiSettingsPath = homePath + '/.modisettings';
modiCommandPath = homePath + '/modi';
break;
}
if (fs.existsSync(modiSettingsPath)) {
fs.unlinkSync(modiSettingsPath);
}
if (modiCommandPath != '')
if (fs.existsSync(modiCommandPath)) {
fs.unlinkSync(modiCommandPath);
}