Whitespace cleanup

This commit is contained in:
Bruno Sutic 2020-06-14 11:37:47 +02:00
parent e4e21f3f48
commit da1a755802
No known key found for this signature in database
GPG Key ID: CAFA7B1B2914ED81

View File

@ -104,13 +104,13 @@ Here's the general workflow for figuring this out:
- Now that you know the full and the desired process string use tilde `~` and - Now that you know the full and the desired process string use tilde `~` and
arrow `->` in `.tmux.conf` to make things work. arrow `->` in `.tmux.conf` to make things work.
### Working with NodeJS <a name="nodejs"></a> ### Working with NodeJS <a name="nodejs"></a>
If you are working with NodeJS, you may get some troubles with configuring restoring programs. If you are working with NodeJS, you may get some troubles with configuring restoring programs.
Particularly, some programs like `gulp`, `grunt` or `npm` are not saved with parameters so tmux-resurrect cannot restore it. This is actually **not tmux-resurrect's issue** but more likely, those programs' issues. For example if you run `gulp watch` or `npm start` and then try to look at `ps` or `pgrep`, you will only see `gulp` or `npm`. Particularly, some programs like `gulp`, `grunt` or `npm` are not saved with parameters so tmux-resurrect cannot restore it. This is actually **not tmux-resurrect's issue** but more likely, those programs' issues. For example if you run `gulp watch` or `npm start` and then try to look at `ps` or `pgrep`, you will only see `gulp` or `npm`.
To deal with these issues, one solution is to use [yarn](https://yarnpkg.com/en/docs/install) which a package manager for NodeJS and an alternative for `npm`. It's nearly identical to `npm` and very easy to use. Therefore you don't have to do any migration, you can simply use it immediately. For example: To deal with these issues, one solution is to use [yarn](https://yarnpkg.com/en/docs/install) which a package manager for NodeJS and an alternative for `npm`. It's nearly identical to `npm` and very easy to use. Therefore you don't have to do any migration, you can simply use it immediately. For example:
- `npm test` is equivalent to `yarn test`, - `npm test` is equivalent to `yarn test`,
- `npm run watch:dev` is equivalent to `yarn watch:dev` - `npm run watch:dev` is equivalent to `yarn watch:dev`
- more interestingly, `gulp watch:dev` is equivalent to `yarn gulp watch:dev` - more interestingly, `gulp watch:dev` is equivalent to `yarn gulp watch:dev`
@ -124,11 +124,11 @@ It's fairly straight forward if you have been using `yarn` already.
#### npm #### npm
Instead of Instead of
set -g @resurrect-processes '"~npm run watch"' # will NOT work set -g @resurrect-processes '"~npm run watch"' # will NOT work
we use we use
set -g @resurrect-processes '"~yarn watch"' # OK set -g @resurrect-processes '"~yarn watch"' # OK
@ -148,14 +148,14 @@ If you use `nvm` in your project, here is how you could config tmux-resurrect:
set -g @resurrect-processes '"~yarn gulp test->nvm use && gulp test"' set -g @resurrect-processes '"~yarn gulp test->nvm use && gulp test"'
#### Another problem #### Another problem
Let take a look at this example Let take a look at this example
set -g @resurrect-processes '\ set -g @resurrect-processes '\
"~yarn gulp test->gulp test" \ "~yarn gulp test->gulp test" \
"~yarn gulp test-it->gulp test-it" \ "~yarn gulp test-it->gulp test-it" \
' '
**This will not work properly**, only `gulp test` is run, although you can see the command `node /path/to/yarn gulp test-it` is added correctly in `.tmux/resurrect/last` file. **This will not work properly**, only `gulp test` is run, although you can see the command `node /path/to/yarn gulp test-it` is added correctly in `.tmux/resurrect/last` file.
The reason is when restoring program, the **command part after the dash `-` is ignored** so instead of command `gulp test-it`, the command `gulp test` which will be run. The reason is when restoring program, the **command part after the dash `-` is ignored** so instead of command `gulp test-it`, the command `gulp test` which will be run.
@ -163,7 +163,7 @@ A work around, for this problem until it's fixed, is:
- the config should be like this: - the config should be like this:
set -g @resurrect-processes '\ set -g @resurrect-processes '\
"~yarn gulp test->gulp test" \ "~yarn gulp test->gulp test" \
"~yarn gulp \"test-it\"->gulp test-it" \ "~yarn gulp \"test-it\"->gulp test-it" \
- and in `.tmux/resurrect/last`, we should add quote to `test-it` word - and in `.tmux/resurrect/last`, we should add quote to `test-it` word