From 8aa4a5e63aaf7ebea980583ede285f4e44d18e5e Mon Sep 17 00:00:00 2001 From: Greg Magolan Date: Tue, 2 Apr 2024 22:07:21 -0400 Subject: [PATCH] refactor: use Aspect bazel-lib repo_utils.get_env_var to get HOME directory (#1583) --- npm/private/utils.bzl | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/npm/private/utils.bzl b/npm/private/utils.bzl index 6c875aff6..97d757eda 100644 --- a/npm/private/utils.bzl +++ b/npm/private/utils.bzl @@ -404,13 +404,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