Skip to content

Commit

Permalink
cli: replace cli.js with bin/npm-cli.js and remove cli.js (#12096)
Browse files Browse the repository at this point in the history
* 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: npm/npm#12096
Credit: @watilde
Reviewed-By: @zkat
  • Loading branch information
watilde authored and zkat committed Apr 27, 2017
1 parent 7ecd310 commit ee23f43
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 19 deletions.
18 changes: 9 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <command> <args>`. (This is helpful
run npm commands by doing `node bin/npm-cli.js <command> <args>`. (This is helpful
for testing, or running stuff without actually installing npm itself.)

## Windows Install or Upgrade
Expand Down
2 changes: 0 additions & 2 deletions cli.js

This file was deleted.

2 changes: 1 addition & 1 deletion lib/npm.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion scripts/doc-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand Down
6 changes: 3 additions & 3 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 ..
Expand Down

0 comments on commit ee23f43

Please sign in to comment.