Browse Source

fix bins perm on osx and linux

all-modes
pbca26 8 years ago
parent
commit
71879fe870
  1. 1
      main.js
  2. 2
      routes/cache.js
  3. 26
      routes/shepherd.js

1
main.js

@ -54,6 +54,7 @@ const appBasicInfo = {
app.setName(appBasicInfo.name);
app.setVersion(appBasicInfo.version);
shepherd.binFixRights();
shepherd.createIguanaDirs();
const appSessionHash = md5(Date.now());

2
routes/cache.js

@ -306,7 +306,7 @@ cache.one = function(req, res, next) {
let iguanaCorePort = req.query.port ? req.query.port : cache.appConfig.iguanaCorePort;
let errorObj = {
msg: 'error',
result: 'error'
result: 'error',
};
let outObj = {};
const writeCache = function(timeStamp) {

26
routes/shepherd.js

@ -110,6 +110,32 @@ shepherd.testLocation = function(path) {
});
}
// osx and linux
shepherd.binFixRights = function() {
const osPlatform = os.platform();
const _bins = [
iguanaBin,
komododBin,
komodocliBin
];
if (osPlatform === 'darwin' ||
osPlatform === 'linux') {
for (let i = 0; i < _bins.length; i++) {
_fs.stat(_bins[i], function(err, stat) {
if (!err) {
if (parseInt(stat.mode.toString(8), 10) !== 100775) {
console.log(`${_bins[i]} fix permissions`);
fsnode.chmodSync(_bins[i], '0775');
}
} else {
console.log(`error: ${_bins[i]} not found`);
}
});
}
}
}
shepherd.killRogueProcess = function(processName) {
// kill rogue process copies on start
let processGrep;

Loading…
Cancel
Save