From da1a7558024b8552f7262b39ed22e3d679304f99 Mon Sep 17 00:00:00 2001 From: Bruno Sutic Date: Sun, 14 Jun 2020 11:37:47 +0200 Subject: [PATCH] Whitespace cleanup --- docs/restoring_programs.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/restoring_programs.md b/docs/restoring_programs.md index 995d0a7..e43b435 100644 --- a/docs/restoring_programs.md +++ b/docs/restoring_programs.md @@ -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 arrow `->` in `.tmux.conf` to make things work. -### Working with NodeJS +### Working with NodeJS 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`. -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`, +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 run watch:dev` is equivalent to `yarn 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 -Instead of +Instead of set -g @resurrect-processes '"~npm run watch"' # will NOT work -we use +we use 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"' -#### Another problem +#### Another problem Let take a look at this example set -g @resurrect-processes '\ - "~yarn gulp test->gulp test" \ + "~yarn gulp test->gulp test" \ "~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. @@ -163,7 +163,7 @@ A work around, for this problem until it's fixed, is: - the config should be like this: set -g @resurrect-processes '\ - "~yarn gulp test->gulp test" \ + "~yarn gulp test->gulp test" \ "~yarn gulp \"test-it\"->gulp test-it" \ - and in `.tmux/resurrect/last`, we should add quote to `test-it` word