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
feat: implement substitute command for the native CLI (#65)
`ngssc substitute` substitutes the variable ${NGSSC_CSP_HASH} in files ending with ".template"
and copies the file while removing the ".template" extension.
${NGSSC_CSP_HASH} represents the CSP hash value of the IIFE generated/inserted by the
insert command, wrapped by single quotes.
By default looks for "*.template" files in the current working directory. Specify another
directory to search for "*.template" files via argument.
(e.g. ngssc substitute /path/to/template/files)
When applying the variable(s), the file is copied to the same directory without the
".template" extension with the substituion applied.
(e.g. ngssc substitute: /a/my.conf.template => /a/my.conf)
Use the "--out" flag to define a different output directory.
(e.g. ngssc substitute --out=/b: /a/my.conf.template => /b/my.conf)
Optionally supports substituting environment variables with the --include-env flag.
The format ${EXAMPLE} must be used ($EXAMPLE will not work). Additionally only
alphanumeric characters and _ are allowed as variable names (e.g. ${EXAMPLE_KEY}).
(e.g. ngssc substitute --include-env)
Closes#64
|`--ngssc-path`| Path to the ngssc.json file or containing directory to be used for the generated IIFE. Supports glob. Defaults to [current working directory]/\*\*/ngssc.json. Throws if multiple ngssc.json with different variant or variables are found. |
203
+
|`--hash-algorithm, -a`| The hash algorithm to be used. Supports sha256, sha384 and sha512. Defaults to sha512. |
204
+
|`--out, -o`| The directory into which the updated files should be copied. |
205
+
|`--include-env, -e`| Substitute all variables in the format of \$\{VARIABLE_NAME\}. |
206
+
|`--dry`| Perform the insert without actually inserting the variables |
0 commit comments