This is driving me nuts. I’m using sed in coffeescript to replace a line in a config file that looks as follows:
'username' => 'username',
My code looks like this:
commands.push "sed -i '' '119 s/\(.\)username.,$/\1" + dbinfo.dbUser + "\1,/g' '" + tmpAppDir + "/drupal/sites/default/settings.php'"
This should totally work, except coffeescript is interpreting my backreferences as octal escape sequences (Not allowed under strict mode.
I wouldn’t have to use backreferences if I was able to escape single-quotes, but that doesn’t really seem possible in this context.
Any help?
Try wrapping your code in pure javascript with
`It’s not an elegant solution, but it’s an easy fix for your code.