S
S
ScarletFlash2018-07-18 13:16:00
bash
ScarletFlash, 2018-07-18 13:16:00

How to escape double quotes in a bash script run via npm run?

Good afternoon.
Made a crutch in node_modules , which is removed when you run npm install .
I want to write a script that will recreate the crutch:
package.json:

"scripts": {
    "ng": "ng",
    "prepare": "cd node_modules && mkdir zlib && cd zlib && echo \"{ \"name\": \"zlib\", \"version\": \"1.0.0\" }\" > package.json",
    "start": "ng serve --o",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },

I tried different options - ' " ' , \ ", did not help. It is clear that you can take the script to a file. Interested in such screening.)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sim3x, 2018-07-18
@sim3x

"prepare": "cd node_modules && mkdir zlib && cd zlib && echo '{ "name":  "zlib", "version": "1.0.0" }' > package.json",

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question