Skip to content

Commit 434a3c4

Browse files
committed
Use USERPROFILE env variable on Windows
$HOME is not defined by default on Windows. $USERPROFILE will return the desired value fixes actions-rs#185, actions-rs#137
1 parent b6efa9c commit 434a3c4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/commands/rustup.ts

Lines changed: 2 additions & 2 deletions
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)