Template that provides examples of using project modules
This repository requires Rust language/compiler to build from source. As of last update to this ReadMe file, the recommended method of installing Rust is via the official installer script...
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
To use the generate
command-line option the cargo-generate
crate needs to be installed...
cargo install cargo-generate
This repository is a template intended to assist with setting up new Rust applications that use internal modules.
Examples are provided for directory, file, and shared modules, as well as how to use
each within various scopes.
cargo generate --name 'your-application-name'\
--git https://github.com/rust-utilities/template-project-modules.git
If this template is wanted as a favorite then add it to the $CARGO_HOME/cargo-generate
configuration file, eg...
[favorite.project-modules]
description = "Template for application scoped modules"
git = "https://github.com/rust-utilities/template-project-modules.git"
branch = "main"
... Then the following command may be used for generating new projects from this template...
cargo generate project-modules your-application-name
Generate a new project using this template, then change the current working directory, and either build
or run
via cargo
command...
cargo generate project-modules your-application-name
cd your-application-name
cargo run
... Customize the files within the src/
directory and enjoy!
This repository may not be feature complete and/or fully functional, Pull Requests that add features or fix bugs are certainly welcomed.
Options for contributing to template-project-modules and rust-utilities
Start making a Fork of this repository to an account that you have write permissions for.
- Add remote for fork URL. The URL syntax is
git@github.com:<NAME>/<REPO>.git
...
cd ~/git/hub/rust-utilities/template-project-modules
git remote add fork git@github.com:<NAME>/template-project-modules.git
- Commit your changes and push to your fork, eg. to fix an issue...
cd ~/git/hub/rust-utilities/template-project-modules
git commit -F- <<'EOF'
:bug: Fixes #42 Issue
**Edits**
- `<SCRIPT-NAME>` script, fixes some bug reported in issue
EOF
git push fork main
Note, the
-u
option may be used to setfork
as the default remote, eg.git push -u fork main
however, this will also default thefork
remote for pulling from too! Meaning that pulling updates fromorigin
must be done explicitly, eg.git pull origin main
- Then on GitHub submit a Pull Request through the Web-UI, the URL syntax is
https://github.com/<NAME>/<REPO>/pull/new/<BRANCH>
Note; to decrease the chances of your Pull Request needing modifications before being accepted, please check the dot-github repository for detailed contributing guidelines.
Thanks for even considering it!
Via Liberapay you may on a repeating basis.
Regardless of if you're able to financially support projects such as template-project-modules that rust-utilities maintains, please consider sharing projects that are useful with others, because one of the goals of maintaining Open Source repositories is to provide value to the community.
Template that provides examples of using project modules
Copyright (C) 2021 S0AndS0
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, version 3 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
For further details review full length version of AGPL-3.0 License.