scripts
scripts copied to clipboard
Make sed commands more robust
sed -i "" '12,15d' ./index.js
I'd be a bit wary of using hard-coded line numbers. Seems like you could get the same results while being way more future-proof (in case CRA changes in the future) with something like:
sed -substitute
Find final );\n in file ./index.js
Grab it and everything after it.
Replace all of the above with the final );\n
sed -i 's|();\n)[\s\S]*|\1|' ./index.js