Developing shouldn't be too hard, just follow the instructions listed below.
You can set up the entire development environment using the provided Bash script.
curl -sSL https://raw.githubusercontent.com/owen-debiasio/cmdcreate/main/dev/setup_env.sh -o /tmp/setup_env.sh
bash -i /tmp/setup_env.shThis script will:
- Detect your Linux distribution
- Install all required dependencies
- Install Rust using
rustup - Clone the
cmdcreaterepository - Prepare shell scripts for development
If you prefer setting everything up yourself, follow the instructions below.
Note
Package names vary between distributions. The lists below match what the setup script installs.
sudo pacman -S --needed \
rustup curl openssl git base-devel \
shfmt shellcheck \
python-black python-pylint \
nodejs npm markdownlint-cli2 prettiersudo apt update
sudo apt install -y \
curl libssl-dev build-essential pkg-config git \
shfmt shellcheck \
black pylint \
nodejs npm \
rpm-tools dpkg
sudo dnf install -y \
curl openssl-devel git \
shfmt ShellCheck \
python3-black python3-pylint \
nodejs npm \
rpm-build dpkg-devRust is installed using rustup.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -yAfter installation, load Cargo into your shell:
source "$HOME/.cargo/env"Set the default toolchain:
rustup default stableNote
Arch Linux users can skip this step if markdownlint-cli2 and prettier was
installed via pacman.
npm install -g prettier markdownlint-cli2Clone the repository and prepare the scripts:
git clone https://github.com/owen-debiasio/cmdcreate.git <desired directory>
cd <desired directory>
find . -maxdepth 1 -name "*.sh" -exec chmod +x {} +The <desired directory> may include paths such as ~/dev/cmdcreate or
$HOME/dev/cmdcreate.
Note
Run these commands from the parent directory of cmdcreate.
./testing/install.sh./testing/uninstall.sh- RustRover
- Primary IDE for developing cmdcreate
- PyCharm
- Working with testing scripts
- Visual Studio Code
- Editing and revising documentation
I recommend using the following linters and formatters to keep the cmdcreate codebase clean:
- RustFmt
- Rust-Analyzer
- PyLint
- Black
- Shfmt
- Shellcheck
- Prettier
- Markdownlint
Note
In the end, I don't care what you use, these are just my recommendations.
-
dev/setup_env.shSets up the development environment. -
dev/clean.shCleans up the development environment. -
dev/format.shFormats all Bash, Python, and Rust code. -
dev/install.shInstall a test (non-production) version of cmdcreate. -
dev/uninstall.shRemove the testing version.
testing/main.pyRun a script that exercises cmdcreate features.
Note
You can read more here: Testing the Features of cmdcreate
-
package/create_bin.shPackages a standalonex86_64binary. -
package/create_deb.shPackages a Debian.deb. -
package/create_rpm.shPackages an RPM. -
package/package.shBuilds all supported package formats.
Note
You can read more here: Packaging cmdcreate
I highly recommend checking out The File Structure of cmdcreate. Get familiar with the project layout before making changes.