fix: use root-tools in pwsh

This commit is contained in:
Amin Yahyaabadi 2022-08-08 00:52:09 -07:00
parent 4a78b34d52
commit b8aa27fad9
1 changed files with 3 additions and 3 deletions

View File

@ -7,7 +7,7 @@ import { isArch } from "../utils/env/isArch"
import { hasDnf } from "../utils/env/hasDnf" import { hasDnf } from "../utils/env/hasDnf"
import { setupDnfPack } from "../utils/setup/setupDnfPack" import { setupDnfPack } from "../utils/setup/setupDnfPack"
import { isUbuntu } from "../utils/env/isUbuntu" 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 // eslint-disable-next-line @typescript-eslint/no-unused-vars
export async function setupPowershell(version: string | undefined, _setupDir: string, _arch: string) { 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") return setupPacmanPack("powershell-bin", version, "yay")
} else if (hasDnf()) { } else if (hasDnf()) {
setupDnfPack("curl") setupDnfPack("curl")
execSudo("/bin/bash", [ execRootSync("/bin/bash", [
"-c", "-c",
`curl https://packages.microsoft.com/config/rhel/8/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo`, `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", "microsoft.asc",
"https://packages.microsoft.com/keys/microsoft.asc" "https://packages.microsoft.com/keys/microsoft.asc"
) )
execSudo("/bin/bash", [ execRootSync("/bin/bash", [
"-c", "-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`, `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`,
]) ])