Skip to content

nathanss/search-and-replace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 

Repository files navigation

PLEASE BACKUP BEFORE APPLYING THIS SCRIPT TO A DIRECTORY

search-and-replace

This is a very simple tool that replaces, at the same time, directory names, file names, and file contents, based on a simple pattern.

Imagine that you have this project structure:

  • RootProject/
    • PREFIX1DIRECTORY/
      • PREFIX1FILE.java
      • SomeFile.js

And PREFIX1FILE.java content is:

asdasdasdasdasprefix1
PREFIX1
Something
Blablabla

If you run the following command:

sar RootProject/ "PREFIX1" "SomethingElse"

Your new project structure will be:

  • RootProject/
    • SomethingElseDIRECTORY/
      • SomethingElseFILE.java
      • SomeFile.js

And SomethingElseFILE.java content will be:

asdasdasdasdasSomethingElse
SomethingElse
Something
Blablabla

Important:

  • When the character "/" is provided as a pattern, it will be replaced with "#" on file and directory names.
  • The search for the old pattern is case insensitive in file's contents, and the new pattern is replaced exactly as provided.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages