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

Commit

Permalink
Use USERPROFILE env variable on Windows
Browse files Browse the repository at this point in the history
$HOME is not defined by default on Windows.
$USERPROFILE will return the desired value

fixes actions-rs/toolchain#185, actions-rs/toolchain#137
  • Loading branch information
lionel-faber committed Jan 3, 2022
1 parent b6efa9c commit 314b264
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/commands/rustup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ export class RustUp {
);
}

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

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

0 comments on commit 314b264

Please sign in to comment.