0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-03-03 09:31:22 -05:00

refactor: rewrite chown_test.ts not to depend on python (#8843)

This commit rewrites "chown_test.ts" to use the GNU "id" command 
instead of python. This won't work on Windows, but these tests aren't
currently run on Windows anyway.
This commit is contained in:
Liam Murphy 2020-12-22 02:30:59 +11:00 committed by GitHub
parent b1c2d21935
commit 4033b39036
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,11 +12,11 @@ async function getUidAndGid(): Promise<{ uid: number; gid: number }> {
// get the user ID and group ID of the current process
const uidProc = Deno.run({
stdout: "piped",
cmd: ["python", "-c", "import os; print(os.getuid())"],
cmd: ["id", "-u"],
});
const gidProc = Deno.run({
stdout: "piped",
cmd: ["python", "-c", "import os; print(os.getgid())"],
cmd: ["id", "-g"],
});
assertEquals((await uidProc.status()).code, 0);