Closed erkyrath closed 8 years ago
Not actually working the way I thought, since the install occurs in a staging directory which has never had "git init".
Think I have it working. I wound up with this line, for which I apologize sincerely:
"preinstall": "if [ -f quixe/LICENSE ]; then echo Quixe already installed; elif [ -d .git ]; then git submodule init; git submodule update; else git clone https://github.com/erkyrath/quixe.git; fi",
Covers these cases:
npm install -g https://github.com/erkyrath/lectrote.git
Check out, npm install
, npm install -g
If you changed it to a postinstall script, then you wouldn't need that check?
Another option would be to just publish quixe on npm. The build script (and main.js I guess) could check if the quixe folder exists and use it if it does, falling back to node_modules if it doesn't.
You should be able to use the npm_config_binroot config var in cli.sh - if you're asking for npm root -g
then it won't work when it's running locally, won't it? (I'm writing all of this without testing it, so if it does work then just ignore!)
I tried postinstall first, but it was not sufficient. The install location doesn't have .git either.
I may publish on npm eventually, but not today.
I figure if you're running locally you're not using cli.sh, but rather npm start game.ulx
.
Everybody needs it, so I might as well automate it. It means you need git to install lectrote, but that was already true.