Reputation: 1
"scripts": {
"release": "npm run release| tee output1.txt",
"build":"npm run build | tee output.txt"
},
Then I used:
npm run release
Output:Killed
Please help I pass two test cases one is remaining
Upvotes: 0
Views: 6311
Reputation: 231
This is what you are expecting.
"scripts": {
"release": "npm -v && node -v",
"build":"node index.js"
}
run below commands and you can get the output as expected.
npm run release| tee output1.txt
npm run build | tee output.txt
Upvotes: 1
Reputation: 8756
This is a perfect case for post scripts:
"scripts": {
"release": "do something",
"postrelease": "tee output1.txt",
"build": "do something different",
"postbuild": "tee output.txt"
},
Upvotes: 0
Reputation: 8773
Scripts tag is generally used to automate repetitive tasks. You can define any number of these.
"scripts": {
"release": "npm run release| tee output1.txt && npm run build | tee output.txt",
},
The && is referred to as AND_IF helps you to run both the commands in sequence that means if first command fails to execute it won't run the next command.
Upvotes: 0
Reputation: 1
you can combine scripts by && operator. They will be executed one by one
"scripts": { "release": "npm run release && tee output1.txt", "build":"npm run build && tee output.txt" }
Upvotes: 0