Commit graph

132 commits

Author SHA1 Message Date
Pavel Djundik 51684f7a2a Switch default home location to ~/.thelounge and remove support of .lounge_home 2018-02-19 20:43:53 +02:00
Pavel Djundik a3e448acf5 Enable no-var rule
Fixes #1961
2018-02-19 19:49:39 +02:00
Pavel Djundik 2685f46669
Merge pull request #1834 from thelounge/astorije/rm-deprecated-options
Remove deprecated options for `thelounge start`
2018-02-19 19:10:14 +02:00
Pavel Djundik a09b21decd
Merge pull request #1733 from thelounge/astorije/home_option_env_var
Remove deprecated support for the `--home` option and `$LOUNGE_HOME` environment variable
2018-02-19 18:51:44 +02:00
Jérémie Astori 416f45d1e3 Use some ES6/Node v4-only syntax when possible 2018-02-19 18:30:00 +02:00
Jérémie Astori c432ee431d Switch to Node v6 as the oldest version we support
Removed a deprecation notice I added in an earlier commit (ef1c59072c).
2018-02-19 18:30:00 +02:00
Pavel Djundik 0d074f1cbe Provide exact version into npm install command 2018-02-14 12:09:02 +02:00
Jérémie Astori 6d931e8dcb
Make sure packages are correctly removed from package.json when uninstalled 2018-02-13 01:06:31 -05:00
Jérémie Astori 2c570fa9ef
Load packages from package.json, fix loading thelounge metadata from the wrong file, add tests 2018-02-13 01:06:31 -05:00
Jérémie Astori 432023fc7e
Make sure existing packages (and themes) are not deleted when installing a new one on Node.js v8
- 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.
2018-01-16 20:25:35 -05:00
Jérémie Astori 45dc52886e
Fix thelounge uninstall command
- 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
2018-01-13 02:00:37 -05:00
Jérémie Astori d2388dc623
Bail when uninstalling if package.json for TL packages does not exist
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.
2018-01-06 12:12:10 -05:00
Jérémie Astori 3971ecff63
Customize a bit thelounge install|uninstall
- 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)
2018-01-06 12:12:10 -05:00
Jérémie Astori d9cb640c2a
Add a thelounge uninstall command to remove themes and packages 2018-01-06 12:12:09 -05:00
Jérémie Astori 96d3e58734
Remove deprecated options for thelounge start
This was replaced with the `--config` option.
2017-12-13 01:33:25 -05:00
Jérémie Astori 826482bb5b
Remove deprecated support for the --home option and $LOUNGE_HOME environment variable 2017-12-12 02:54:50 -05:00
Jérémie Astori d89112173d
Fix command line index parsing options (--home and --config) twice 2017-12-11 23:53:51 -05:00
Jérémie Astori 6547d18e7f
Color all references to deprecations in bold red 2017-12-11 23:48:52 -05:00
Jérémie Astori 07a01b0547
Deprecate existing options of thelounge start in favor or -c, --config 2017-12-11 23:48:52 -05:00
Jérémie Astori df2787d3e9
Add a --config / -c option to the start CLI command to arbitrarily override any configuration key
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.
2017-12-11 23:48:52 -05:00
Jérémie Astori b90c224a99
Define a raw logger to avoid using console.log, use it in extra help for environment variables, and add a test for this
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
2017-12-11 23:48:51 -05:00
Jérémie Astori c21aee3d4a
Do not load user commands or display them on --help if public mode or using LDAP 2017-12-09 01:51:08 -05:00
Jérémie Astori c038935b96
Move user commands to their own subfolder 2017-12-09 01:38:52 -05:00
Jérémie Astori 52d5cb2311
Expand home shorthand in CLI help around THELOUNGE_HOME environment variable 2017-12-07 23:03:40 -05:00
Jérémie Astori 0482747781
Only use helpers and not shared variables around path helpers
This refactor has a few benefits, for example there cannot be a rogue update of `Helper.CONFIG_PATH` or something.
2017-12-07 23:02:32 -05:00
Jérémie Astori 052248445c
Do not rename home file as it is very likely to have permission issues
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.
2017-12-01 01:33:04 -05:00
Pavel Djundik ba002cca64
Merge pull request #1708 from thelounge/astorije/thelounge
Switch CLI tool from `lounge` to `thelounge`, deprecate `lounge`
2017-11-27 13:58:46 +02:00
Jérémie Astori aca23257ed
Switch CLI tool from lounge to thelounge and deprecate lounge
This is in preparation of The Lounge v3 which will make `thelounge` uniform across the entire project. No more confusion!
2017-11-22 16:37:26 -05:00
Jérémie Astori 827f1dab96
Deprecate LOUNGE_HOME env var in favor of THELOUNGE_HOME, .lounge_home file in favor of .thelounge_home
This is one more step towards uniformization of lounge/thelounge due with The Lounge v3.
2017-11-21 00:36:26 -05:00
Pavel Djundik adab03f730 Fix test 2017-11-19 19:43:43 +02:00
Jérémie Astori f2d9ef62cf
Merge pull request #1715 from thelounge/astorije/deprecate-node-v4
Deprecate support of Node v4 in preparation of The Lounge v3
2017-11-19 01:05:57 -05:00
Jérémie Astori ef1c59072c
Deprecate support of Node v4 in preparation of The Lounge v3 2017-11-18 13:52:31 -05:00
Jérémie Astori 1dc92d8934
Enforce dangling commas with ESLint
¯\_(ツ)_/¯
2017-11-15 01:35:15 -05:00
Jérémie Astori 0cc9c4166b Merge pull request #1583 from thelounge/astorije/thelounge-packages
Use `thelounge` instead of `lounge` when it comes to external packages
2017-09-30 23:47:02 -04:00
Pavel Djundik 1c4d9351d5 Add info message before calling packageJson 2017-09-29 10:54:03 +03:00
Jérémie Astori 1e10cc66a6
Use thelounge instead of lounge when it comes to external packages 2017-09-29 00:03:01 -04:00
Pavel Djundik 416ebf97ff Create 'lounge install' command 2017-09-20 10:59:06 +03:00
Jérémie Astori b8399471b3
Enable ESLint no-console rule to avoid future mistakes 2017-09-17 21:50:21 -04:00
Jérémie Astori 234fd31411
Clarify some users.length that were forgotten in a previous PR 2017-08-26 12:04:13 -04:00
Pavel Djundik 252dca3d3f
Only create config folder in 'start' command
Fixes #520.
Fixes #1288.
2017-08-26 12:04:13 -04:00
Jérémie Astori ed68ff4a34
Make sure CLI does not crash on undefined.length when we figured out users could not be read already 2017-08-23 13:21:15 -04:00
Jérémie Astori aa49856446
Warn when adding or listing users in public mode 2017-08-23 13:21:14 -04:00
Jérémie Astori f221121998
Inform when no users during autoload to take into account removing the last user 2017-08-23 13:21:14 -04:00
Jérémie Astori 90842267e8
Do not prevent server to run when there are no users in private mode 2017-08-23 13:20:46 -04:00
Jérémie Astori ac3ce74343
Read default LOUNGE_HOME from .lounge_home file 2017-08-21 02:03:40 -04:00
Jérémie Astori 98bfe349d9
Add documentation for LOUNGE_HOME environment variable in the CLI helper 2017-08-21 01:49:32 -04:00
Jérémie Astori 507cc61d5c
Rename new file holding config location for consistency
`.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.
2017-08-16 00:34:29 -04:00
Jérémie Astori 5e7a7a3870
Update CLI help with regard to recent deprecation of --home option
- 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
2017-08-16 00:33:33 -04:00
Pavel Djundik 5299d976c0 Use .lounge_config to help distribution packages handle config paths right 2017-08-15 21:57:47 +03:00
Pavel Djundik c14f7da1b2 Generate unique tokens for each login and session 2017-07-31 02:02:15 +03:00