Skip to content

Commit

Permalink
refactor: use Aspect bazel-lib repo_utils.get_env_var to get HOME dir…
Browse files Browse the repository at this point in the history
…ectory (aspect-build#1583)
  • Loading branch information
gregmagolan authored and jbedard committed May 16, 2024
1 parent e8ba0f9 commit 4c4701d
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions npm/private/utils.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -428,13 +428,8 @@ if [ ! -f $1 ]; then exit 42; fi
else:
fail(INTERNAL_ERROR_MSG)

# TODO(2.0): move this to aspect_bazel_lib
def _home_directory(rctx):
if "HOME" in rctx.os.environ and not repo_utils.is_windows(rctx):
return rctx.os.environ["HOME"]
if "USERPROFILE" in rctx.os.environ and repo_utils.is_windows(rctx):
return rctx.os.environ["USERPROFILE"]
return None
return repo_utils.get_env_var(rctx, "HOME", None)

def _replace_npmrc_token_envvar(token, npmrc_path, environ):
# A token can be a reference to an environment variable
Expand Down

0 comments on commit 4c4701d

Please sign in to comment.