tool.sh is a simple tool for managing C/C++ projects that use Git. It was designed after I got tired of typing out CMake commands.
There are a few dependencies for this script, as they are used in some of it's functions. The script will check for dependencies at the start of most functions.
The dependencies are:
- Git
- CMake
- Ninja
- Download this repository
- Extract the zip file somewhere
- Copy the file tool.sh into the root directory of your project
- Give the tool executable permissions (
chmod +x tool.sh
) - Check if you have the necessary dependencies installed (
./tool.sh depends
) - (Optional) Customise the Generation and Build functions to suit your project (Eg. Change compiler, CMake options, Check for necessary project dependencies, etc.)
See the examples in tool.sh under the 'dependencies section'. Below is an example for wget
declare -A wget=([name]="Wget" [path]="$(pathBinary wget)" [has]=$(hasBinary wget))
addProjectDependent "${wget[@]}"
- 'depends': Check if necessary tool.sh and project dependencies are installed
- 'help': Show this message
- 'version': Output version information
- 'build': Build project using ninja (Generation is done automatically)
- 'gen': Generate CMake build files
- 'release': Build release binaries (Generation is done automatically)
- 'clean': Clean CMake files, debugging files, and generated files
- 'debug': Generate debugging files
- 'add' <files>: Track the specified files with git (Takes multiple files)
- 'commit: "message": commits tracked changed files (Takes a message in double quotes)
- 'push': Pushes pending commits
- 'cab': Clean and Build
- 'cap': Commit and Push
If you have found an issue or would like to request a new feature, please add an issue