process#getuid TypeScript Examples
The following examples show how to use
process#getuid.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: manifest.ts From flatpak-vscode with MIT License | 6 votes |
runInRepo(shellCommand: string, mountExtensions: boolean, additionalEnvVars?: Map<string, string>): Command {
const uid = getuid()
const appId = this.id()
let args = [
'build',
'--with-appdir',
'--allow=devel',
`--bind-mount=/run/user/${uid}/doc=/run/user/${uid}/doc/by-app/${appId}`,
...this.finishArgs(),
'--talk-name=org.freedesktop.portal.*',
'--talk-name=org.a11y.Bus',
]
const envVars = getHostEnv()
if (additionalEnvVars !== undefined) {
for (const [key, value] of additionalEnvVars) {
envVars.set(key, value)
}
}
for (const [key, value] of envVars) {
args.push(`--env=${key}=${value}`)
}
if (mountExtensions) {
args = args.concat(this.getPaths())
// Assume we might need network access by the executable
args.push('--share=network')
}
args.push(this.repoDir)
args.push(shellCommand)
return new Command('flatpak', args, { cwd: this.workspace })
}