Compare commits

..

3 Commits

Author SHA1 Message Date
David Welch
68e95247a1
Merge 29331ff1a77889d644d4aa786d5b0b2097bb21e1 into 762f9ef9d17623b45095e8ca1a996c8928f3f424 2024-07-23 02:17:36 +00:00
David Welch
29331ff1a7
[New] Add support for NVM_AUTH_HEADER env var
Closes #3366

Co-authored-by: David Welch <david@davidwelch.co>
Co-authored-by: Andre Kradolfer <narfdre@gmail.com>
2024-06-21 08:55:22 -06:00
Andre Kradolfer
60db94a9b3
[debug] adding logging to makefile 2024-07-22 14:07:07 -06:00
2 changed files with 17 additions and 21 deletions

View File

@ -1,28 +1,28 @@
# Since we rely on paths relative to the makefile location, abort if make isn't being run from there. # Since we rely on paths relative to the makefile location, abort if make isn't being run from there.
$(if $(findstring /,$(MAKEFILE_LIST)),$(error Please only invoke this makefile from the directory it resides in)) $(if $(findstring /,$(MAKEFILE_LIST)),$(error Please only invoke this makefile from the directory it resides in))
# Note: With Travis CI: # Note: With Travis CI:
# - the path to urchin is passed via the command line. # - the path to urchin is passed via the command line.
# - the other utilities are NOT needed, so we skip the test for their existence. # - the other utilities are NOT needed, so we skip the test for their existence.
URCHIN := urchin URCHIN := urchin
ifeq ($(findstring /,$(URCHIN)),) # urchin path was NOT passed in. ifeq ($(findstring /,$(URCHIN)),) # urchin path was NOT passed in.
# Add the local npm packages' bin folder to the PATH, so that `make` can find them, when invoked directly. # Add the local npm packages' bin folder to the PATH, so that `make` can find them, when invoked directly.
# Note that rather than using `$(npm bin)` the 'node_modules/.bin' path component is hard-coded, so that invocation works even from an environment # Note that rather than using `$(npm bin)` the 'node_modules/.bin' path component is hard-coded, so that invocation works even from an environment
# where npm is (temporarily) unavailable due to having deactivated an nvm instance loaded into the calling shell in order to avoid interference with tests. # where npm is (temporarily) unavailable due to having deactivated an nvm instance loaded into the calling shell in order to avoid interference with tests.
export PATH := $(shell printf '%s' "$$PWD/node_modules/.bin:$$PATH") export PATH := $(shell printf '%s' "$$PWD/node_modules/.bin:$$PATH")
# The list of all supporting utilities, installed with `npm install`. # The list of all supporting utilities, installed with `npm install`.
UTILS := $(URCHIN) replace semver UTILS := $(URCHIN) replace semver
# Make sure that all required utilities can be located. # Make sure that all required utilities can be located.
UTIL_CHECK := $(or $(shell PATH="$(PATH)" which $(UTILS) >/dev/null && echo 'ok'),$(error Did you forget to run `npm install` after cloning the repo? At least one of the required supporting utilities not found: $(UTILS))) UTIL_CHECK := $(or $(shell PATH="$(PATH)" which $(UTILS) >/dev/null && echo 'ok'),$(error Did you forget to run `npm install` after cloning the repo? At least one of the required supporting utilities not found: $(UTILS)))
endif endif
# The files that need updating when incrementing the version number. # The files that need updating when incrementing the version number.
VERSIONED_FILES := nvm.sh install.sh README.md package.json VERSIONED_FILES := nvm.sh install.sh README.md package.json
# Define all shells to test with. Can be overridden with `make SHELLS=... <target>`. # Define all shells to test with. Can be overridden with `make SHELLS=... <target>`.
SHELLS := sh bash dash zsh # ksh (#574) SHELLS := sh bash dash zsh # ksh (#574)
# Generate 'test-<shell>' target names from specified shells. # Generate 'test-<shell>' target names from specified shells.
# The embedded shell names are extracted on demand inside the recipes. # The embedded shell names are extracted on demand inside the recipes.
SHELL_TARGETS := $(addprefix test-,$(SHELLS)) SHELL_TARGETS := $(addprefix test-,$(SHELLS))
# Define the default test suite(s). This can be overridden with `make TEST_SUITE=<...> <target>`. # Define the default test suite(s). This can be overridden with `make TEST_SUITE=<...> <target>`.
# Test suites are the names of subfolders of './test'. # Test suites are the names of subfolders of './test'.
TEST_SUITE := $(shell find ./test/* -type d -prune -exec basename {} \;) TEST_SUITE := $(shell find ./test/* -type d -prune -exec basename {} \;)

View File

@ -535,11 +535,7 @@ NVM_IOJS_ORG_MIRROR=https://iojs.org/dist nvm install iojs-v1.0.3
To pass an Authorization header through to the mirror url, set `$NVM_AUTH_HEADER` To pass an Authorization header through to the mirror url, set `$NVM_AUTH_HEADER`
```sh ```sh
export NVM_NODEJS_ORG_MIRROR=https://nodejs.org/dist NVM_AUTH_HEADER="Bearer secret-token" nvm install node
export NVM_AUTH_HEADER="Bearer secret-token"
nvm install node
NVM_NODEJS_ORG_MIRROR=https://nodejs.org/dist NVM_AUTH_HEADER="Bearer secret-token" nvm install 4.2
``` ```
### .nvmrc ### .nvmrc