Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a preinstall script to grab the quixe submodule #23

Closed
erkyrath opened this issue Feb 8, 2016 · 4 comments
Closed

Add a preinstall script to grab the quixe submodule #23

erkyrath opened this issue Feb 8, 2016 · 4 comments
Labels

Comments

@erkyrath
Copy link
Owner

erkyrath commented Feb 8, 2016

Everybody needs it, so I might as well automate it. It means you need git to install lectrote, but that was already true.

@erkyrath
Copy link
Owner Author

erkyrath commented Feb 8, 2016

Not actually working the way I thought, since the install occurs in a staging directory which has never had "git init".

@erkyrath
Copy link
Owner Author

erkyrath commented Feb 8, 2016

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

@curiousdannii
Copy link
Contributor

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!)

@erkyrath
Copy link
Owner Author

erkyrath commented Feb 8, 2016

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.

@erkyrath erkyrath closed this as completed Feb 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants