This repository provides a bash script, clone_and_rename.sh, which clones a specified Ruby base repository and then renames certain predefined elements.
The script performs the following operations:
- Clones the ruby_base repository from Github into a directory with a user-provided name.
- Deletes the .git directory inside the newly created directory and re-initializes Git.
- Renames any files or directories within the new directory that start with "base_projects" to start with the user-provided name.
- Replaces any occurrences of "BaseProject" in the files within the new directory with the CamelCase version of the user-provided name.
- Replaces any occurrences of "base_projects" in the files within the new directory with the user-provided name.
To use the script, you need to download it and make it executable. Here's a one-liner that accomplishes this, runs the script, and then deletes it:
wget https://raw.githubusercontent.com/zewelor/ruby_base/main/clone_and_rename.sh && chmod +x clone_and_rename && ./clone_and_rename new_project && rm clone_and_rename
In the command above, replace new_project with your desired name. This command will clone the repository and replace all occurrences of "base_projects" and "BaseProject" with your provided name and its CamelCase equivalent, respectively.
If you need help or want to view the usage instructions, you can download the script and run:
./clone_and_rename.sh -h