Skip to content

Commit 3b67ed1

Browse files
docs: nicer quotes
It's generally a good practice to prefer single-quotes in shell script strings unless you plan on interpolating environment variables. It's purely stylistic here, but there's something about shell code that looks safer at first-glance. It's sorta like the how SQL query string _can_ be safe when concatenating another string directly onto it, but it doesn't _look_ as safe at first glance as one that escapes the inputs. Plus, given that the NPM scripts are already inside a JSON strings, getting rid of the escaped characters makes it look neater! :3
1 parent 11500d4 commit 3b67ed1

File tree

6 files changed

+29
-29
lines changed

6 files changed

+29
-29
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ The tool is written in Node.js, but you can use it to run **any** commands.
6161
Remember to surround separate commands with quotes:
6262

6363
```bash
64-
concurrently "command1 arg" "command2 arg"
64+
concurrently 'command1 arg' 'command2 arg'
6565
```
6666

6767
Otherwise **concurrently** would try to run 4 separate commands:
@@ -70,7 +70,7 @@ Otherwise **concurrently** would try to run 4 separate commands:
7070
In package.json, escape quotes:
7171

7272
```bash
73-
"start": "concurrently \"command1 arg\" \"command2 arg\""
73+
"start": "concurrently 'command1 arg' 'command2 arg'"
7474
```
7575

7676
You can always check concurrently's flag list by running `concurrently --help`.

docs/cli/input-handling.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,37 @@ By default, concurrently doesn't send input to any commands it spawns.<br/>
44
In the below example, typing `rs` to manually restart [nodemon](https://nodemon.io/) does nothing:
55

66
```bash
7-
$ concurrently "nodemon" "npm run watch-js"
7+
$ concurrently 'nodemon' 'npm run watch-js'
88
rs
99
```
1010

1111
To turn on input handling, it's necessary to set the `--handle-input`/`-i` flag.<br/>
1212
This will send `rs` to the first command:
1313

1414
```bash
15-
$ concurrently --handle-input "nodemon" "npm run watch-js"
15+
$ concurrently --handle-input 'nodemon' 'npm run watch-js'
1616
rs
1717
```
1818

1919
To send input to a different command instead, it's possible to prefix the input with the command index, followed by a `:`.<br/>
2020
For example, the below sends `rs` to the second command:
2121

2222
```bash
23-
$ concurrently --handle-input "npm run watch-js" "nodemon"
23+
$ concurrently --handle-input 'npm run watch-js' 'nodemon'
2424
1:rs
2525
```
2626

2727
If the command has a name, it's also possible to target it using that command's name:
2828

2929
```bash
30-
$ concurrently --handle-input --names js,server "npm run watch-js" "nodemon"
30+
$ concurrently --handle-input --names js,server 'npm run watch-js' 'nodemon'
3131
server:rs
3232
```
3333

3434
It's also possible to change the default command that receives input.<br/>
3535
To do this, set the `--default-input-target` flag to a command's index or name.
3636

3737
```bash
38-
$ concurrently --handle-input --default-input-target 1 "npm run watch-js" "nodemon"
38+
$ concurrently --handle-input --default-input-target 1 'npm run watch-js' 'nodemon'
3939
rs
4040
```

docs/cli/output-control.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ concurrently offers a few ways to control a command's output.
77
A command's outputs (and all its events) can be hidden by using the `--hide` flag.
88

99
```bash
10-
$ concurrently --hide 0 "echo Hello there" "echo 'General Kenobi!'"
10+
$ concurrently --hide 0 'echo Hello there' 'echo General Kenobi!'
1111
[1] General Kenobi!
1212
[1] echo 'General Kenobi!' exited with code 0
1313
```
@@ -18,7 +18,7 @@ It might be useful at times to make sure that the commands outputs are grouped t
1818
This can be done with the `--group` flag.
1919

2020
```bash
21-
$ concurrently --group "echo Hello there && sleep 2 && echo 'General Kenobi!'" "echo hi Star Wars fans"
21+
$ concurrently --group 'echo Hello there && sleep 2 && echo General Kenobi!' 'echo hi Star Wars fans'
2222
[0] Hello there
2323
[0] General Kenobi!
2424
[0] echo Hello there && sleep 2 && echo 'General Kenobi!' exited with code 0
@@ -31,5 +31,5 @@ $ concurrently --group "echo Hello there && sleep 2 && echo 'General Kenobi!'" "
3131
When piping concurrently's outputs to another command or file, you might want to force it to not use colors, as these can break the other command's parsing, or reduce the legibility of the output in non-terminal environments.
3232

3333
```bash
34-
$ concurrently -c red,blue --no-color "echo Hello there" "echo 'General Kenobi!'"
34+
$ concurrently -c red,blue --no-color 'echo Hello there' 'echo General Kenobi!'
3535
```

docs/cli/prefixing.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
concurrently will by default prefix each command's outputs with a zero-based index, wrapped in square brackets:
66

77
```bash
8-
$ concurrently "echo Hello there" "echo 'General Kenobi!'"
8+
$ concurrently 'echo Hello there' "echo 'General Kenobi!'"
99
[0] Hello there
1010
[1] General Kenobi!
1111
[0] echo Hello there exited with code 0
@@ -15,7 +15,7 @@ $ concurrently "echo Hello there" "echo 'General Kenobi!'"
1515
If you've given the commands names, they are used instead:
1616

1717
```bash
18-
$ concurrently --names one,two "echo Hello there" "echo 'General Kenobi!'"
18+
$ concurrently --names one,two 'echo Hello there' "echo 'General Kenobi!'"
1919
[one] Hello there
2020
[two] General Kenobi!
2121
[one] echo Hello there exited with code 0
@@ -36,7 +36,7 @@ There are other prefix styles available too:
3636
Any of these can be used by setting the `--prefix`/`-p` flag. For example:
3737

3838
```bash
39-
$ concurrently --prefix pid "echo Hello there" "echo 'General Kenobi!'"
39+
$ concurrently --prefix pid 'echo Hello there' 'echo General Kenobi!'
4040
[2222] Hello there
4141
[2223] General Kenobi!
4242
[2222] echo Hello there exited with code 0
@@ -47,7 +47,7 @@ It's also possible to have a prefix based on a template. Any of the styles liste
4747
Doing so will also remove the square brackets:
4848

4949
```bash
50-
$ concurrently --prefix "{index}-{pid}" "echo Hello there" "echo 'General Kenobi!'"
50+
$ concurrently --prefix '{index}-{pid}' 'echo Hello there' 'echo General Kenobi!'
5151
0-2222 Hello there
5252
1-2223 General Kenobi!
5353
0-2222 echo Hello there exited with code 0
@@ -62,7 +62,7 @@ This can be changed by using the `--prefix-colors`/`-c` flag, which takes a comm
6262
The available values are color names (e.g. `green`, `magenta`, `gray`, etc), a hex value (such as `#23de43`), or `auto`, to automatically select a color.
6363

6464
```bash
65-
$ concurrently -c red,blue "echo Hello there" "echo 'General Kenobi!'"
65+
$ concurrently -c red,blue 'echo Hello there' 'echo General Kenobi!'
6666
```
6767

6868
<details>
@@ -82,7 +82,7 @@ $ concurrently -c red,blue "echo Hello there" "echo 'General Kenobi!'"
8282
Colors can take modifiers too. Several can be applied at once by prepending `.<modifier 1>.<modifier 2>` and so on.
8383

8484
```bash
85-
$ concurrently -c red,bold.blue.dim "echo Hello there" "echo 'General Kenobi!'"
85+
$ concurrently -c red,bold.blue.dim 'echo Hello there' 'echo General Kenobi!'
8686
```
8787

8888
<details>
@@ -101,7 +101,7 @@ $ concurrently -c red,bold.blue.dim "echo Hello there" "echo 'General Kenobi!'"
101101
A background color can be set in a similary fashion.
102102

103103
```bash
104-
$ concurrently -c bgGray,red.bgBlack "echo Hello there" "echo 'General Kenobi!'"
104+
$ concurrently -c bgGray,red.bgBlack 'echo Hello there' 'echo General Kenobi!'
105105
```
106106

107107
<details>
@@ -124,7 +124,7 @@ When using the `command` prefix style, it's possible that it'll be too long.<br/
124124
It can be limited by setting the `--prefix-length`/`-l` flag:
125125

126126
```bash
127-
$ concurrently -p command -l 10 "echo Hello there" "echo 'General Kenobi!'"
127+
$ concurrently -p command -l 10 'echo Hello there' 'echo General Kenobi!'
128128
[echo..here] Hello there
129129
[echo..bi!'] General Kenobi!
130130
[echo..here] echo Hello there exited with code 0
@@ -135,7 +135,7 @@ It's also possible that some prefixes are too short, and you want all of them to
135135
This can be done by setting the `--pad-prefix` flag:
136136

137137
```bash
138-
$ concurrently -n foo,barbaz --pad-prefix "echo Hello there" "echo 'General Kenobi!'"
138+
$ concurrently -n foo,barbaz --pad-prefix 'echo Hello there' 'echo General Kenobi!'
139139
[foo ] Hello there
140140
[foo ] echo Hello there exited with code 0
141141
[barbaz] General Kenobi!

docs/cli/restarting.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Sometimes it's useful to have commands that exited with a non-zero status to res
44
concurrently lets you configure how many times you wish for such a command to restart through the `--restart-tries` flag:
55

66
```bash
7-
$ concurrently --restart-tries 2 "exit 1"
7+
$ concurrently --restart-tries 2 'exit 1'
88
[0] exit 1 exited with code 1
99
[0] exit 1 restarted
1010
[0] exit 1 exited with code 1
@@ -16,7 +16,7 @@ Sometimes, it might be interesting to have commands wait before restarting.<br/>
1616
To do this, simply set `--restart-after` to a the number of milliseconds you'd like to delay restarting.
1717

1818
```bash
19-
$ concurrently -p time --restart-tries 1 --restart-after 3000 "exit 1"
19+
$ concurrently -p time --restart-tries 1 --restart-after 3000 'exit 1'
2020
[2024-09-01 23:43:55.871] exit 1 exited with code 1
2121
[2024-09-01 23:43:58.874] exit 1 restarted
2222
[2024-09-01 23:43:58.891] exit 1 exited with code 1
@@ -26,7 +26,7 @@ If a command is not having success spawning, you might want to instead apply an
2626
Set `--restart-after exponential` to have commands respawn with a `2^N` seconds delay.
2727

2828
```bash
29-
$ concurrently -p time --restart-tries 3 --restart-after exponential "exit 1"
29+
$ concurrently -p time --restart-tries 3 --restart-after exponential 'exit 1'
3030

3131
[2024-09-01 23:49:01.124] exit 1 exited with code 1
3232
[2024-09-01 23:49:02.127] exit 1 restarted

docs/cli/shortcuts.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ For example, given the following `package.json` contents:
3535
It's possible to run some of these with the following command line:
3636

3737
```bash
38-
$ concurrently "pnpm:lint:js"
38+
$ concurrently 'pnpm:lint:js'
3939
# Is equivalent to
40-
$ concurrently -n lint:js "pnpm run lint:js"
40+
$ concurrently -n lint:js 'pnpm run lint:js'
4141
```
4242

4343
Note that the command automatically receives a name equal to the script name.
@@ -46,25 +46,25 @@ If you have several scripts with similar name patterns, you can use the `*` wild
4646
The spawned commands will receive names set to whatever the `*` wildcard matched.
4747

4848
```bash
49-
$ concurrently "npm:lint:fix:*"
49+
$ concurrently 'npm:lint:fix:*'
5050
# is equivalent to
51-
$ concurrently -n js,ts "npm run lint:fix:js" "npm run lint:fix:ts"
51+
$ concurrently -n js,ts 'npm run lint:fix:js' 'npm run lint:fix:ts'
5252
```
5353

5454
If you specify a command name when using wildcards, it'll be a prefix of what the `*` wildcard matched:
5555

5656
```bash
57-
$ concurrently -n fix: "npm:lint:fix:*"
57+
$ concurrently -n fix: 'npm:lint:fix:*'
5858
# is equivalent to
59-
$ concurrently -n fix:js,fix:ts "npm run lint:fix:js" "npm run lint:fix:ts"
59+
$ concurrently -n fix:js,fix:ts 'npm run lint:fix:js' 'npm run lint:fix:ts'
6060
```
6161

6262
Filtering out commands matched by wildcard is also possible. Do this with by including `(!<some pattern>)` in the command line:
6363

6464
```bash
6565
$ concurrently 'yarn:lint:*(!fix)'
6666
# is equivalent to
67-
$ concurrently -n js,ts "yarn run lint:js" "yarn run lint:ts"
67+
$ concurrently -n js,ts 'yarn run lint:js' 'yarn run lint:ts'
6868
```
6969

7070
> [!NOTE]

0 commit comments

Comments
 (0)