From b8aa27fad930e3402a2cafd31ddc736b34c2b6c5 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Mon, 8 Aug 2022 00:52:09 -0700 Subject: [PATCH] fix: use root-tools in pwsh --- src/powershell/powershell.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/powershell/powershell.ts b/src/powershell/powershell.ts index e9483bdd..3550cc28 100644 --- a/src/powershell/powershell.ts +++ b/src/powershell/powershell.ts @@ -7,7 +7,7 @@ import { isArch } from "../utils/env/isArch" import { hasDnf } from "../utils/env/hasDnf" import { setupDnfPack } from "../utils/setup/setupDnfPack" import { isUbuntu } from "../utils/env/isUbuntu" -import { execSudo } from "../utils/exec/sudo" +import { execRootSync } from "root-tools" // eslint-disable-next-line @typescript-eslint/no-unused-vars export async function setupPowershell(version: string | undefined, _setupDir: string, _arch: string) { @@ -26,7 +26,7 @@ export async function setupPowershell(version: string | undefined, _setupDir: st return setupPacmanPack("powershell-bin", version, "yay") } else if (hasDnf()) { setupDnfPack("curl") - execSudo("/bin/bash", [ + execRootSync("/bin/bash", [ "-c", `curl https://packages.microsoft.com/config/rhel/8/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo`, ]) @@ -36,7 +36,7 @@ export async function setupPowershell(version: string | undefined, _setupDir: st "microsoft.asc", "https://packages.microsoft.com/keys/microsoft.asc" ) - execSudo("/bin/bash", [ + execRootSync("/bin/bash", [ "-c", `echo "deb [arch=amd64 signed-by=${keyFileName}] https://packages.microsoft.com/repos/microsoft-debian-bullseye-prod bullseye main" > /etc/apt/sources.list.d/microsoft.list`, ])