mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-08-17 19:13:43 +00:00
Compare commits
5 Commits
ff7f2cb026
...
ab9456dfc2
Author | SHA1 | Date | |
---|---|---|---|
![]() |
ab9456dfc2 | ||
![]() |
e51d3a52cc | ||
![]() |
a6f7913463 | ||
![]() |
79737fe6bb | ||
![]() |
78e9f45878 |
28
Makefile
28
Makefile
@ -1,8 +1,8 @@
|
|||||||
# 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.
|
||||||
@ -14,15 +14,15 @@ ifeq ($(findstring /,$(URCHIN)),) # urchin path was NOT passed in.
|
|||||||
# 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 {} \;)
|
||||||
|
|
||||||
|
|
||||||
@ -40,10 +40,14 @@ list:
|
|||||||
# Note that preexisting NVM_* variables are unset to avoid interfering with tests, except when running the Travis tests (where NVM_DIR must be passed in and the env. is assumed to be pristine).
|
# Note that preexisting NVM_* variables are unset to avoid interfering with tests, except when running the Travis tests (where NVM_DIR must be passed in and the env. is assumed to be pristine).
|
||||||
.PHONY: $(SHELL_TARGETS)
|
.PHONY: $(SHELL_TARGETS)
|
||||||
$(SHELL_TARGETS):
|
$(SHELL_TARGETS):
|
||||||
@shell='$@'; shell=$${shell##*-}; which "$$shell" >/dev/null || { printf '\033[0;31m%s\033[0m\n' "WARNING: Cannot test with shell '$$shell': not found." >&2; exit 0; } && \
|
@shell='$@'; shell=$${shell##*-}; \
|
||||||
|
which "$$shell" >/dev/null || { printf '\033[0;31m%s\033[0m\n' "WARNING: Cannot test with shell '$$shell': not found." >&2; exit 0; } && \
|
||||||
printf '\n\033[0;34m%s\033[0m\n' "Running tests in $$shell"; \
|
printf '\n\033[0;34m%s\033[0m\n' "Running tests in $$shell"; \
|
||||||
[ -z "$$TRAVIS_BUILD_DIR" ] && for v in $$(set | awk -F'=' '$$1 ~ "^NVM_" { print $$1 }'); do unset $$v; done && unset v; \
|
[ -z "$$TRAVIS_BUILD_DIR" ] && for v in $$(set | awk -F'=' '$$1 ~ "^NVM_" { print $$1 }'); do unset $$v; done && unset v; \
|
||||||
for suite in $(TEST_SUITE); do $(URCHIN) -f -s $$shell test/$$suite || exit; done
|
for suite in $(TEST_SUITE); do \
|
||||||
|
echo "Running test suite: $$suite"; \
|
||||||
|
$(URCHIN) -f -s $$shell test/$$suite || exit; \
|
||||||
|
done
|
||||||
|
|
||||||
# All-tests target: invokes the specified test suites for ALL shells defined in $(SHELLS).
|
# All-tests target: invokes the specified test suites for ALL shells defined in $(SHELLS).
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
|
@ -535,7 +535,11 @@ 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
|
||||||
NVM_AUTH_HEADER="Bearer secret-token" nvm install node
|
export NVM_NODEJS_ORG_MIRROR=https://nodejs.org/dist
|
||||||
|
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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user