From ee23f43bd339777399973cb0aded07cc3a004735 Mon Sep 17 00:00:00 2001 From: Daijiro Wachi Date: Wed, 5 Apr 2017 05:19:33 +0900 Subject: [PATCH] cli: replace cli.js with bin/npm-cli.js and remove cli.js (#12096) * scripts: replace cli.js with npm-cli.js * cli: remove unused file cli.js * docs: replace cli.js with bin/npm-cli.js PR-URL: https://github.com/npm/npm/pull/12096 Credit: @watilde Reviewed-By: @zkat --- Makefile | 18 +++++++++--------- README.md | 2 +- cli.js | 2 -- lib/npm.js | 2 +- scripts/doc-build.sh | 2 +- scripts/install.sh | 4 ++-- scripts/release.sh | 6 +++--- 7 files changed, 17 insertions(+), 19 deletions(-) delete mode 100755 cli.js diff --git a/Makefile b/Makefile index d0f94d68dc961..2555ad13820f6 100644 --- a/Makefile +++ b/Makefile @@ -53,23 +53,23 @@ latest: @echo "Installing latest published npm" @echo "Use 'make install' or 'make link' to install the code" @echo "in this folder that you're looking at right now." - node cli.js install -g -f npm ${NPMOPTS} + node bin/npm-cli.js install -g -f npm ${NPMOPTS} install: all - node cli.js install -g -f ${NPMOPTS} + node bin/npm-cli.js install -g -f ${NPMOPTS} # backwards compat dev: install link: uninstall - node cli.js link -f + node bin/npm-cli.js link -f clean: markedclean marked-manclean doc-clean uninstall rm -rf npmrc - node cli.js cache clean + node bin/npm-cli.js cache clean uninstall: - node cli.js rm npm -g -f + node bin/npm-cli.js rm npm -g -f doc: $(mandocs) $(htmldocs) @@ -143,19 +143,19 @@ html/doc/misc/%.html: doc/misc/%.md $(html_docdeps) marked: node_modules/.bin/marked node_modules/.bin/marked: - node cli.js install marked --no-global --no-timing + node bin/npm-cli.js install marked --no-global --no-timing marked-man: node_modules/.bin/marked-man node_modules/.bin/marked-man: - node cli.js install marked-man --no-global --no-timing + node bin/npm-cli.js install marked-man --no-global --no-timing doc: man man: $(cli_docs) test: doc - node cli.js test + node bin/npm-cli.js test tag: node bin/npm-cli.js tag npm@$(PUBLISHTAG) latest @@ -173,7 +173,7 @@ publish: gitclean ls-ok link doc-clean doc node bin/npm-cli.js publish --tag=$(PUBLISHTAG) release: gitclean ls-ok markedclean marked-manclean doc-clean doc - node cli.js prune --production + node bin/npm-cli.js prune --production @bash scripts/release.sh sandwich: diff --git a/README.md b/README.md index cad3409cd9d59..3a96074afb4f0 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ If you plan on hacking on npm, `make link` is your friend. If you've got the npm source code, you can also semi-permanently set arbitrary config keys using the `./configure --key=val ...`, and then -run npm commands by doing `node cli.js `. (This is helpful +run npm commands by doing `node bin/npm-cli.js `. (This is helpful for testing, or running stuff without actually installing npm itself.) ## Windows Install or Upgrade diff --git a/cli.js b/cli.js deleted file mode 100755 index 05c5e21fb1eb5..0000000000000 --- a/cli.js +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env node -require('./bin/npm-cli.js') diff --git a/lib/npm.js b/lib/npm.js index eadff8a698914..f389cbb176efc 100644 --- a/lib/npm.js +++ b/lib/npm.js @@ -101,7 +101,7 @@ if (!loaded) { throw new Error( 'Call npm.load(config, cb) before using this command.\n' + - 'See the README.md or cli.js for example usage.' + 'See the README.md or bin/npm-cli.js for example usage.' ) } var a = npm.deref(c) diff --git a/scripts/doc-build.sh b/scripts/doc-build.sh index 61819028be39b..b951eb7d36257 100755 --- a/scripts/doc-build.sh +++ b/scripts/doc-build.sh @@ -62,7 +62,7 @@ src=$1 dest=$2 name=$(basename ${src%.*}) date=$(date -u +'%Y-%m-%d %H:%M:%S') -version=$(node cli.js -v) +version=$(node bin/npm-cli.js -v) mkdir -p $(dirname $dest) diff --git a/scripts/install.sh b/scripts/install.sh index e6624f06160d3..a81faba584649 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -256,8 +256,8 @@ cd "$TMP" \ make="NOMAKE" fi if [ "$make" = "NOMAKE" ]; then - "$node" cli.js rm npm -gf - "$node" cli.js install -gf + "$node" bin/npm-cli.js rm npm -gf + "$node" bin/npm-cli.js install -gf fi) \ && cd "$BACK" \ && rm -rf "$TMP" \ diff --git a/scripts/release.sh b/scripts/release.sh index abe6c197f37fa..1a0c3b6875a45 100644 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -8,7 +8,7 @@ set -e rm -rf release *.tgz || true mkdir release -node ./cli.js pack --loglevel error >/dev/null +node ./bin/npm-cli.js pack --loglevel error >/dev/null mv *.tgz release cd release tar xzf *.tgz @@ -18,12 +18,12 @@ mv package node_modules/npm # make the zip for windows users cp node_modules/npm/bin/*.cmd . -zipname=npm-$(node ../cli.js -v).zip +zipname=npm-$(node ../bin/npm-cli.js -v).zip zip -q -9 -r -X "$zipname" *.cmd node_modules # make the tar for node's deps cd node_modules -tarname=npm-$(node ../../cli.js -v).tgz +tarname=npm-$(node ../../bin/npm-cli.js -v).tgz tar czf "$tarname" npm cd ..