No description
Find a file
2024-04-22 19:29:49 +08:00
docs chore: bump sudo 0.1.1 2024-04-22 19:29:49 +08:00
src chore: bump sudo 0.1.1 2024-04-22 19:29:49 +08:00
LICENSE feat: initial release 2024-04-22 16:07:02 +08:00
makedocs.sh feat: allow pass filter(k,v): bool to sudo() instead 2024-04-22 19:27:48 +08:00
README.md chore: bump sudo 0.1.1 2024-04-22 19:29:49 +08:00
sudo.nimble chore: bump sudo 0.1.1 2024-04-22 19:29:49 +08:00

sudo.nim

Detect if you are running as root, restart self with sudo if needed or setup uid zero when running with the SUID flag set.

Installation

In your <pkgname>.nimble file:

requires "sudo >= 0.1.0"

Then run nimble install --depsOnly.

Example

import sudo

discard sudo()

# or…
discard sudo(["QT_"])  # this exports environment variables that start with QT_
discard sudo((k, _) => k.startsWith("QT_"))  # equivalent to above