forwards-long-jump / discotron

Modular Discord bot supporting plugins hosted on git repositories
MIT License
3 stars 5 forks source link

Use Javascript instead of a shell script for npm install #48

Closed Blatoy closed 5 years ago

sowmiyamuthuraman commented 5 years ago

Hii, I would like to work on this!

Blatoy commented 5 years ago

Feel free to do a PR for it!

RedMser commented 5 years ago

The basic idea would be to move the install.sh script over to node.js (so it runs on Windows as well). Either as a new pre-install script, or when you first launch the bot/index.js file.

In the end, the following files have to be present:

with the prompted values pre-filled (and possibly validated similarly).

The folder used to be hardcoded to a default path /instance/, but it'd be very nice to use the value of --config-path instead (stored in global.discotronConfigPath after parsing args).

To detect on startup if installation needs to be run, we also created a file .installed, but in hindsight, a better solution is to simply check if both config files exist!

sowmiyamuthuraman commented 5 years ago

@RedMser is it ok to use readline-sync package to read input from the console?

RedMser commented 5 years ago

is it ok to use readline-sync package to read input from the console?

The package is pretty lightweight (no dependencies), and reading from console is a nightmare with plain node.js, so using that package is no problem at all! :+1: