mirror of
https://github.com/nim-lang/Nim.git
synced 2026-05-04 13:04:44 +00:00
stdlib/os: add isAdmin (#17012)
* stdlib/os: add isAdmin * uint8 -> cuchar, assert isAdmin on Azure Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> * Update lib/pure/os.nim docs Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> * Address comments on #17012 * Raise on errors in #17012 * Check the result of FreeSid in #17012 * Change case in #17012 * Fix memory leak in #17012 * Address comments in #17012 Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
This commit is contained in:
committed by
GitHub
parent
d1e093207a
commit
31424b3808
@@ -655,3 +655,10 @@ block: # normalizeExe
|
||||
doAssert "foo/../bar".dup(normalizeExe) == "foo/../bar"
|
||||
when defined(windows):
|
||||
doAssert "foo".dup(normalizeExe) == "foo"
|
||||
|
||||
block: # isAdmin
|
||||
let isAzure = existsEnv("TF_BUILD") # xxx factor with testament.specs.isAzure
|
||||
# In Azure on Windows tests run as an admin user
|
||||
if isAzure and defined(windows): doAssert isAdmin()
|
||||
# In Azure on POSIX tests run as a normal user
|
||||
if isAzure and defined(posix): doAssert not isAdmin()
|
||||
|
||||
Reference in New Issue
Block a user