pre
is a simple project templating program.
Clone and run install.sh
. You'll be asked to choose between using templates from a GitHub repository or a local folder.
chmod +x install.sh
./install.sh
The installation script will also add the pre
script to your PATH
by modifying your .bashrc
and .zshrc
files.
The configuration file is located at $HOME/.pre_config
. It contains the path to the templates directory:
bash
TEMPLATE_FOLDER="/path/to/your/templates"
You can edit this file to change the source of your templates.
To initialize a new project, run the pre
script:
pre
-
List available templates:
- The script will list all available templates in the configured template directory.
-
Select a template:
- You will be prompted to select a template by entering its corresponding number.
-
Enter project name:
- You will be prompted to enter a name for your new project.
The script will create a new directory with the project name in the current working directory, copy the selected template's contents into it, and replace instances of {{PROJECT_NAME}}
with the project name in both file names and file contents.
To uninstall the Project Templating System, run the uninstall.sh
script:
bash
./uninstall.sh
-
Remove the configuration file:
- The script will remove the configuration file located at
$HOME/.pre_config
.
- The script will remove the configuration file located at
-
Remove the template directory:
- You will be prompted to confirm whether you want to remove the template directory and its contents.
-
Remove the main script from PATH:
- The script will remove the
pre
script from theBIN_DIR
($HOME/bin
).
- The script will remove the
To create a new project using a template:
- Run the
pre
script:
bash pre
- Select a template from the list of available templates.
- Enter a name for your new project.
The new project will be initialized in the current directory.
This project is licensed under the MIT License. `