Skip to content

Commit

Permalink
remove userid
Browse files Browse the repository at this point in the history
  • Loading branch information
slavaGanzin committed Feb 1, 2023
1 parent fb8a7f0 commit 40af0c3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 2 additions & 3 deletions callmemaybe.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ const yaml = require('yaml')
const { program } = require('commander')
const {run, healthcheck} = require('./run')
const http = require('http')
const userid = require('userid')

const wait = t => new Promise(r => setTimeout(r, t))

Expand Down Expand Up @@ -93,8 +92,8 @@ program.command('start')
})
const opts = {}
if (c.folder) opts.cwd = c.folder
if (c.user) opts.uid = userid.uid(c.user)
if (c.group) opts.gid = userid.gid(c.user)
if (c.user) opts.uid = await user2uid(c.user)
if (c.group) opts.gid = await group2gid(c.user)
if (c.shell) opts.shell = c.shell

console.log(opts)
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"execa": "^5.1.1",
"got": "^11.8.3",
"ramda": "^0.28.0",
"userid": "^1.2.5",
"yaml": "^2.2.1"
}
}
5 changes: 4 additions & 1 deletion run.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,7 @@ const healthcheck = (c, name, wait, opts) => {
return Promise.reject({})
}

module.exports = {run, healthcheck}
const user2uid = user => execa(`id -u ${user}`)
const group2gid = group => execa(`id -g ${group}`)

module.exports = {run, healthcheck, user2uid, group2gid}

0 comments on commit 40af0c3

Please sign in to comment.