- When installing a package on Node v8 (or whatever npm version ships with it - v5), all packages not listed in `package.json` are removed. Since we explicitly added `--no-save`, installing a theme would delete the previous one. I am now checking that the file already exists or not. This means that it will still happen to people the next time they run `thelounge install`, because the previous install did not save into `package.json` :/
- Adding `--save` to make sure that the same, correct behavior is done on Node v6 as well (npm v3)
- Adding `--save-exact` for good measure.
- Exit with code 1 when package was not installed
- Run a pre-step to check if package is installed before uninstalling. I have tried every possible way I could think of without that first `npm list` step based on output of `npm uninstall`, but different npm versions produce different outputs, so there is nothing reliable. This is a more robust way to do so anyway.
- Consolidate error handlers
It is on purpose that the message is the same than when a package was not installed. From a user standpoint, it only matters that this specific package was not installed.
- Hides progress bars that flash when installing/uninstalling as it does not bring real value here, at least for now
- Inform user if package being uninstalled was not actually installed
- Do not display npm outputs, mention which version was installed (this will probably need refining when installing packages with dependencies)
The biggest caveat is that JS code (such as functions) will not be interpreted as such, on purpose, for security precautions. If such thing is needed, then a configuration file must be used.
This has multiple benefits:
- Respects the "Do not mock what you do not own" principle, instead we mock `log.raw` when necessary
- Lets us not re-assign `console.log`, which breaks as Mocha uses `console.log` as well
- Save and restore initial `log.raw` in test hooks (before/after), otherwise this would break Mocha/Chai
On most systems (Linux at least), to install a npm package locally, one must use `sudo`. When The Lounge runs, it usually does not run with `sudo`. This causes the program to crash as user running The Lounge cannot create/delete files there.
We will let people manually convert this file instead of doing it for them. This file is mainly intended for package authors anyway, most users will never have to touch it.
`.lounge_config` is misleading as this file does not contain the config itself. Also, env var is called `LOUNGE_HOME`, deprecated flag is `--home`, so it makes more sense that way.
- Mark the option as deprecated (cannot be removed from the help, unfortunately)
- Add details to `lounge config` regarding `LOUNGE_HOME`
- Remove mention of `--home` in default config file
In v2.2.1 (and in pretty much every software out there, really), `-h` was an alias of `--help`. By adding it as an alias of `--home`, it is now shown twice in the help.