-
Notifications
You must be signed in to change notification settings - Fork 740
Closed
Labels
questionQuestion from a user (which may not require code/documentation changes to the project)Question from a user (which may not require code/documentation changes to the project)
Description
Hello there
Node version (or tell us if you're using electron or some other framework):
v7.10.0
ShellJS version (the most recent version/Github branch you see the bug on):
v0.8.0
Operating system:
MacOs HighSierra 10.13.2
Description of the bug:
I'm using shelljs to perform a sed command and replace the whole line with a certain occurrence with another text. Here's the code that I'm using:
require('shelljs/global');
var new_version = process.argv[2];
sed('-i', /^.*version.*$/,
' "version": "'+new_version+'",',
'package.json');
That version works but it replaces all the occurrence of "version". I have tried this code to replace only the first occurrence:
sed('-i', '0,/^.*version.*$/',
but that's not working at all: the file remains unchanged.
What am I missing?
Metadata
Metadata
Assignees
Labels
questionQuestion from a user (which may not require code/documentation changes to the project)Question from a user (which may not require code/documentation changes to the project)