djblue / pnpm

Simple private npm.
MIT License
0 stars 4 forks source link

cp: illegal option -- u #1

Closed zeke closed 9 years ago

zeke commented 10 years ago

Hi @djblue this looks like an interesting project. I work at npm and used to work at Heroku, so I'm intrigued. :)

cp -u is not a thing on OS X, so I got an error on npm install. I would send a pull request, but I'm not sure if there's an OS X equivalent for the -u flag behavior.

> pnpm@0.0.1 install /Users/z/code/forks/pnpm
> cp -u config.json.template config.json

cp: illegal option -- u
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file ... target_directory

npm ERR! Darwin 13.3.0
npm ERR! argv "node" "/Users/z/.nvm/v0.10.31/bin/npm" "i"
npm ERR! node v0.10.31
npm ERR! npm  v2.1.4
npm ERR! code ELIFECYCLE
npm ERR! pnpm@0.0.1 install: `cp -u config.json.template config.json`
npm ERR! Exit status 64
npm ERR! 
npm ERR! Failed at the pnpm@0.0.1 install script.
npm ERR! This is most likely a problem with the pnpm package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     cp -u config.json.template config.json
npm ERR! You can get their info via:
npm ERR!     npm owner ls pnpm
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/z/code/forks/pnpm/npm-debug.log
iarna commented 10 years ago

To do this on OSX you'd do something like:

[[ config.json.template -nt config.json ]] && cp config.json.template config.json
zeke commented 10 years ago

Would that work nicely on linux too?

iarna commented 10 years ago

Yup, that's just the old school Unix way, instead of this new fangled GNU way with all its fancy options and arguments.

djblue commented 9 years ago

@iarna I tried putting the bash conditional in package.json, npm didn't seem to like it.

So I found a better option -n for cp which might work on OSX. I don't have OSX, so let me know if this works.

@zeke I added a branch osx-cp, can you fetch it and see if that fixes your issue? Thanks for finding this problem.

zeke commented 9 years ago

A PR in progress: https://github.com/djblue/pnpm/pull/3