maxlath / wikibase-cli

read and edit a Wikibase instance from the command line
MIT License
226 stars 24 forks source link

wikidata-cli alias does not work #49

Closed almereyda closed 6 years ago

almereyda commented 6 years ago

After the thankful implementation of #42, this still does not work with a fresh global install:

λ wikidata-cli --help
/home/ya/.nvm/versions/node/v8.9.4/bin/wikidata-cli: Zeile 2: ./bin/wd: No such file or directory

This may be linked with #21 and #25.

maxlath commented 6 years ago

the problem is that the ./bin/wikidata-cli implementation was failing: the script was attempting to refer to a relative file from the project root but won't work when not in the project folder... So I removed ./bin/wikidata-cli (d0df064), and the only alternative I can think of is to suggest you to add an alias:

alias wikdata-cli="/home/ya/.nvm/versions/node/v8.9.4/bin/wd"
almereyda commented 6 years ago

I guess https://github.com/maxlath/wikidata-cli/commit/d0df0648692adbc16de118c8d15dea14eef3f9ca was not as complete as neccessary.

$ npm i -g wikidata-cli
/home/ya/.nvm/versions/node/v8.9.3/bin/wd -> /home/ya/.nvm/versions/node/v8.9.3/lib/node_modules/wikidata-cli/bin/wd
npm ERR! path /home/ya/.nvm/versions/node/v8.9.3/lib/node_modules/wikidata-cli/bin/wikidata-cli
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod '/home/ya/.nvm/versions/node/v8.9.3/lib/node_modules/wikidata-cli/bin/wikidata-cli'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/ya/.npm/_logs/2018-01-16T22_04_04_116Z-debug.log

I also think this alias would be the first in the world to actually extend a command string, and make it artificially longer, instead of shortening it ;)

almereyda commented 6 years ago

Sorry for having caused this with #42 in the first place.

maxlath commented 6 years ago

I made a patch 224c7e9 and published it as v6.0.4

almereyda commented 6 years ago

I'm happy with wd so far. A working PR may be provided in the future independently.