https://github.com/easingthemes/fmp-arguments
https://github.com/easingthemes/fmp-arguments
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/easingthemes/fmp-arguments
- Owner: easingthemes
- License: mit
- Created: 2018-07-05T22:34:47.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-07-05T23:07:47.000Z (almost 8 years ago)
- Last Synced: 2025-03-16T21:23:05.337Z (over 1 year ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
### Escaping quotes in npm task arguments
1. Using FMP:
```
fmp-arguments $mvn clean install
[INFO] ------------------------------------------------------------------------
[INFO] Building fmp quotes 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO] --- frontend-maven-plugin:1.6:npm (Run Script: run npm task with quotes) @ fmp-quotes ---
[INFO] Running 'npm run fmp -- --myarg "Has Space"' in /fmp-arguments
[INFO]
[INFO] > node ./index "--myarg" "\"Has" "Space\""
[INFO]
[INFO] [ '"Has', 'Space"' ]
[INFO] --- frontend-maven-plugin:1.6:npm (Run Script: run npm task with escaped quotes) @ fmp-quotes ---
[INFO] Running 'npm run fmp -- --myarg \"Has Space\"' in /fmp-arguments
[INFO]
[INFO] > node ./index "--myarg" "\\"Has" "Space\\""
[INFO]
[INFO] [ '\\Has Space\\' ]
[INFO] --- frontend-maven-plugin:1.6:npm (Run Script: run npm task without quotes) @ fmp-quotes ---
[INFO] Running 'npm run fmp -- --myarg Has Space' in /fmp-arguments
[INFO]
[INFO] > node ./index "--myarg" "Has" "Space"
[INFO]
[INFO] [ 'Has', 'Space' ]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
```
2. Runing in console:
```
fmp-arguments $npm run fmp -- --myarg "Has Space"
> node ./index "--myarg" "Has Space"
[ 'Has Space' ]
fmp-arguments $npm run fmp -- --myarg \"Has Space\"
> node ./index "--myarg" "\"Has" "Space\""
[ '"Has', 'Space"' ]
fmp-arguments $npm run fmp -- --myarg Has Space
> node ./index "--myarg" "Has" "Space"
[ 'Has', 'Space' ]
```