Skip to content

Commit

Permalink
fix: fileExists()
Browse files Browse the repository at this point in the history
  • Loading branch information
siiky committed Sep 13, 2024
1 parent c7e5a9f commit c07d8d1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion deploy/codebase/lamassu-machine-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,17 @@ function updateSupervisor (cb) {
.includes('IMAGE_ID=lamassu-machine-xubuntu') ?
'lamassu' :
'ubilinux',
_err => 'ubilinux',
err => {
console.log("Error reading /etc/os-release")
return 'ubilinux'
}
)

(machineWithMultipleCodes.includes(hardwareCode) ? getOSUser() : Promise.resolve('lamassu'))
.catch(err => {
console.log(err)
return 'lamassu'
})
.then(osuser => {
async.series([
async.apply(command, `cp ${supervisorPath}/* /etc/supervisor/conf.d/`),
Expand Down
2 changes: 1 addition & 1 deletion deploy/node-update/nodejs-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const unlink = path => new Promise((resolve, reject) =>
fs.unlink(path, err => err ? reject(err) : resolve())
)

const fileExists = path => new Promise(resolve => fs.access(path, err => resolve(!!err)))
const fileExists = path => new Promise(resolve => fs.access(path, err => resolve(!err)))

const execFile = (cmd, args) => new Promise((resolve, reject) =>
child_process.execFile(cmd, args, null, err => err ? reject(err) : resolve())
Expand Down

0 comments on commit c07d8d1

Please sign in to comment.