This project aims to help developers set up their projects quickly and in a standardized way. It performs three main actions: creating folders, cloning Git repositories, and generating task configurations for Visual Studio Code. To use it, follow the instructions below:
Before getting started, it's essential to configure the project by following these steps:
-
Download and install Python (3.6 or higher) on your machine if you haven't already. You can do this by visiting python.org.
-
Download and install Git on your machine if you haven't already. You can do this by visiting git-scm.com.
-
Before running the script for the first time, open the terminal and execute the following command to install the necessary dependency:
pip install gitpython pip install PyYAML pip install GitPython
- Edit the config.json file to configure your projects and repositories.
{
"projects": [
{
"path": "[PROJECT_NAME]",
"config": {
"path": "./"
},
"repositories": [
{
"path": "[REPOSITORY_NAME]", <<< -- Enter the name of the folder where the repository will be downloaded
"repository": "[URL_GIT_REPOSITORY]" <<< -- Repository address
}
// Add more repositories if necessary
],
"tasks": [
{
"label": "[REPOSITORY_NAME]", <<< -- Here you will define the name of the repository
"command": "command_task", <<< -- For more information, go to the VSCode Tasks documentation at https://code.visualstudio.com/docs/editor/tasks-appendix
"group": "[GROUP_NAME]" <<< -- Name of Terminal Grouping in VSCODE
"dependsOn": ["LABEL_DEPEND"] <<< -- Optional, in case you want a dependent task
},
// Add more tasks if necessary
]
}
// Add more projects if necessary
]
}
- Execute the script using the command.
python main.py
The script will create folder structures, download repositories, and generate configurations for VS Code.
This Python script performs specific cleanup in all subdirectories, excluding unnecessary folders and files. It is useful for preparing the environment for a clean installation or compression. Follow the instructions below to use it:
- Execute the script using the command python clean_install.py. Make sure to run the script in the folder where you want to perform the cleanup; it will check all subfolders for files such as package-lock.json, yarn.lock, composer.lock, and folders like node_modules, vendor to remove them.
The script will remove the specified folders recursively, ensuring a clean installation.
This Python script backs up .env files from repositories to the config folder, renaming them according to the {name}-{path}.env pattern.
How to Use - script_backup_env.py Execute the script using the command
python script_backup_env.py
Make sure to run the script in the folder where your project is located. The script will check each repository specified in config.json for a corresponding .env file. If found, it will be copied to the config folder with the modified name.
Create a global module in the NPM
Nota: Make sure to understand the implications of these scripts before running them, especially when deleting folders and files.