Skip to content

Commit 2f57230

Browse files
jhheiderCopilot
andauthored
Apply suggestions from code review
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 43df00c commit 2f57230

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

pkgm.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -299,17 +299,18 @@ async function query_pkgx(
299299

300300
const isRoot = Deno.uid() == 0;
301301
const sudoUser = Deno.env.get("SUDO_USER");
302+
const prefix = install_prefix().string;
302303

303-
if (install_prefix().string == "/usr/local" && isRoot && !sudoUser) {
304+
if (prefix == "/usr/local" && isRoot && !sudoUser) {
304305
console.error(
305306
"%cwarning",
306307
"color:yellow",
307308
"installing as root; installing via `sudo` is preferred",
308309
);
309310
}
310-
311-
const needs_sudo_backwards =
312-
install_prefix().string == "/usr/local" && !isRoot && !sudoUser;
311+
312+
const needs_sudo_backwards =
313+
prefix == "/usr/local" && !isRoot && !sudoUser;
313314

314315
let cmd = pkgx;
315316

0 commit comments

Comments
 (0)