Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.

Commit 314b264

Browse files
committedJan 3, 2022
Use USERPROFILE env variable on Windows
$HOME is not defined by default on Windows. $USERPROFILE will return the desired value fixes actions-rs/toolchain#185, actions-rs/toolchain#137
1 parent b6efa9c commit 314b264

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/commands/rustup.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ export class RustUp {
9090
);
9191
}
9292

93-
// `$HOME` should always be declared, so it is more to get the linters happy
94-
core.addPath(path.join(process.env.HOME!, '.cargo', 'bin')); // eslint-disable-line @typescript-eslint/no-non-null-assertion
93+
// `$HOME` or `$USERPROFILE` should always be declared, so it is more to get the linters happy
94+
core.addPath(path.join((process.env.HOME || process.env.USERPROFILE)!, '.cargo', 'bin')); // eslint-disable-line @typescript-eslint/no-non-null-assertion
9595

9696
// Assuming it is in the $PATH already
9797
return new RustUp('rustup');

0 commit comments

Comments
 (0)