djblue / pnpm

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

Hopefully fixed cp for osx. #3

Closed djblue closed 9 years ago

zeke commented 9 years ago

Works once. Fails on the second run.

pnpm master » npm i           

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

pnpm master » npm i

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

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 -n config.json.template config.json`
npm ERR! Exit status 1
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 -n 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

Using the following snippet has the same effect. Works once, then fails.

[[ config.json.template -nt config.json ]] && cp config.json.template config.json
iarna commented 9 years ago

Ah, right exit values– I'm not surprised the snippet failed. You'd suppress that with:

[[ config.json.template -nt config.json ]] && cp config.json.template config.json || true

I am surprised that cp -n doesn't return success when it doesn't do anything, but you should be able to suppress it the same way:

cp -n config.json.template config.json || true
djblue commented 9 years ago

@zeke Does this work for you?