You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`--name`\|`-n`| Name to be passed to the generated files. `{{name}}` and other data parameters inside contents and file names will be replaced accordingly. You may omit the `--name` or `-n` for this specific option. |
17
-
|`--config`\|`-c`| Filename or directory to load config from |
18
-
|`--git`\|`-g`| Git URL or GitHub path to load a template from. |
19
-
|`--key`\|`-k`| Key to load inside the config file. This overwrites the config key provided after the colon in `--config` (e.g. `--config scaffold.cmd.js:component`) |
20
-
|`--output`\|`-o`| Path to output to. If `--create-sub-folder` is enabled, the subfolder will be created inside this path. Default is current working directory. |
21
-
|`--templates`\|`-t`| Template files to use as input. You may provide multiple files, each of which can be a relative or absolute path, or a glob pattern for multiple file matching easily. |
22
-
|`--overwrite`\|`-w`| Enable to override output files, even if they already exist. |
23
-
|`--data`\|`-d`| Add custom data to the templates. By default, only your app name is included. |
24
-
|`--append-data`\|`-D`| Append additional custom data to the templates, which will overwrite `--data`, using an alternate syntax, which is easier to use with CLI: `-D key1=string -D key2:=raw`|
25
-
|`--create-sub-folder`\|`-s`| Create subfolder with the input name |
26
-
|`--sub-folder-name-helper`\|`-sh`| Default helper to apply to subfolder name when using `--create-sub-folder true`. |
27
-
|`--quiet`\|`-q`| Suppress output logs (Same as `--log-level none`) |
28
-
|`--log-level`\|`-l`| Determine amount of logs to display. The values are: `none \| debug \| info \| warn \| error`. The provided level will display messages of the same level or higher. |
29
-
|`--dry-run`\|`-dr`| Don't emit files. This is good for testing your scaffolds and making sure they don't fail, without having to write actual file contents or create directories. |
|`--name`\|`-n`| Name to be passed to the generated files. `{{name}}` and other data parameters inside contents and file names will be replaced accordingly. You may omit the `--name` or `-n` for this specific option. |
17
+
|`--config`\|`-c`| Filename or directory to load config from |
18
+
|`--git`\|`-g`| Git URL or GitHub path to load a template from. |
19
+
|`--key`\|`-k`| Key to load inside the config file. This overwrites the config key provided after the colon in `--config` (e.g. `--config scaffold.cmd.js:component`) |
20
+
|`--output`\|`-o`| Path to output to. If `--create-sub-folder` is enabled, the subfolder will be created inside this path. Default is current working directory. |
21
+
|`--templates`\|`-t`| Template files to use as input. You may provide multiple files, each of which can be a relative or absolute path, or a glob pattern for multiple file matching easily. |
22
+
|`--overwrite`\|`-w`| Enable to override output files, even if they already exist. |
23
+
|`--data`\|`-d`| Add custom data to the templates. By default, only your app name is included. |
24
+
|`--append-data`\|`-D`| Append additional custom data to the templates, which will overwrite `--data`, using an alternate syntax, which is easier to use with CLI: `-D key1=string -D key2:=raw`|
25
+
|`--create-sub-folder`\|`-s`| Create subfolder with the input name |
26
+
|`--sub-folder-name-helper`\|`-sh`| Default helper to apply to subfolder name when using `--create-sub-folder true`. |
27
+
|`--quiet`\|`-q`| Suppress output logs (Same as `--log-level none`) |
28
+
|`--log-level`\|`-l`| Determine amount of logs to display. The values are: `none \| debug \| info \| warn \| error`. The provided level will display messages of the same level or higher. |
29
+
|`--before-write`\|`-B`| Run a script before writing the files. This can be a command or a path to a file. A temporary file path will be passed to the given command and the command should return a string for the final output. |
30
+
|`--dry-run`\|`-dr`| Don't emit files. This is good for testing your scaffolds and making sure they don't fail, without having to write actual file contents or create directories. |
31
+
|`--help`\|`-h`| Show this help message |
32
+
|`--version`\|`-v`| Display version. |
33
+
34
+
### Before Write option
35
+
36
+
This option allows you to preprocess a file before it is being written, such as running a formatter,
37
+
linter or other commands.
38
+
39
+
To use this option, pass it the command you would like to run. The following tokens will be replaced
40
+
in your string:
41
+
42
+
-`{{path}}` - the temporary file path for you to read from
43
+
-`{{rawpath}}` - a different file path containing the raw file contents **before** they were
44
+
handled by Handlebars.js.
45
+
46
+
If none of these tokens are found, the regular (non-raw) path will be appended to the end of the
0 commit comments