-2

I have a bash script that does the following:

  • Removes a CSS directory
  • Copies over new SASS from source
  • Runs gulp task to generate CSS again

After I copy the SASS over, I would like to do the following before generating CSS again:

Find any occurrence of ('/assets and change it to ('/themes/custom/mytheme/assets in any of the files in the SASS directory.

How can I do that?

Kevin
  • 13,153
  • 11
  • 60
  • 87

1 Answers1

0

As was already mentioned, this can be done for example with a basic sed substitution. The only thing to look out for, is to escape the slashes and to use -i to edit files in place.

sed -i "s/('\/assets/('\/themes\/custom\/mytheme\/assets/" /path/to/SASS/*

jhscheer
  • 342
  • 1
  • 8
  • 18