Skip to content

Latest commit

 

History

History
232 lines (152 loc) · 4.34 KB

File metadata and controls

232 lines (152 loc) · 4.34 KB

Developing cmdcreate

Developing shouldn't be too hard, just follow the instructions listed below.

Setting up developing environment

Run setup script (recommended)

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.sh

This script will:

  • Detect your Linux distribution
  • Install all required dependencies
  • Install Rust using rustup
  • Clone the cmdcreate repository
  • Prepare shell scripts for development

Manual setup

If you prefer setting everything up yourself, follow the instructions below.

Installing dependencies

Note

Package names vary between distributions. The lists below match what the setup script installs.

Arch Linux
sudo pacman -S --needed \
  rustup curl openssl git base-devel \
  shfmt shellcheck \
  python-black python-pylint \
  nodejs npm markdownlint-cli2 prettier
Debian / Ubuntu
sudo apt update
sudo apt install -y \
  curl libssl-dev build-essential pkg-config git \
  shfmt shellcheck \
  black pylint \
  nodejs npm \
  rpm-tools dpkg
Fedora
sudo dnf install -y \
  curl openssl-devel git \
  shfmt ShellCheck \
  python3-black python3-pylint \
  nodejs npm \
  rpm-build dpkg-dev

Install Rust (Debian / Ubuntu / Fedora)

Rust is installed using rustup.

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y

After installation, load Cargo into your shell:

source "$HOME/.cargo/env"

Set the default toolchain:

rustup default stable

Install Markdownlint and Prettier

Note

Arch Linux users can skip this step if markdownlint-cli2 and prettier was installed via pacman.

npm install -g prettier markdownlint-cli2

Setup environment

Clone 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.


Installing / Uninstalling test version

Note

Run these commands from the parent directory of cmdcreate.

Installing
./testing/install.sh
Uninstalling
./testing/uninstall.sh

IDEs I recommend for their purposes

  • RustRover
    • Primary IDE for developing cmdcreate
  • PyCharm
    • Working with testing scripts
  • Visual Studio Code
    • Editing and revising documentation

Linters

I recommend using the following linters and formatters to keep the cmdcreate codebase clean:

Rust

  • RustFmt
  • Rust-Analyzer

Python

  • PyLint
  • Black

Shell Scripts

  • Shfmt
  • Shellcheck

Markdown / Other

  • Prettier
  • Markdownlint

Note

In the end, I don't care what you use, these are just my recommendations.


Utilities I provide

Standard Utilities

  • dev/setup_env.sh Sets up the development environment.

  • dev/clean.sh Cleans up the development environment.

  • dev/format.sh Formats all Bash, Python, and Rust code.

  • dev/install.sh Install a test (non-production) version of cmdcreate.

  • dev/uninstall.sh Remove the testing version.

Testing Purposes

  • testing/main.py Run a script that exercises cmdcreate features.

Note

You can read more here: Testing the Features of cmdcreate


Packaging cmdcreate

  • package/create_bin.sh Packages a standalone x86_64 binary.

  • package/create_deb.sh Packages a Debian .deb.

  • package/create_rpm.sh Packages an RPM.

  • package/package.sh Builds all supported package formats.

Note

You can read more here: Packaging cmdcreate


Get to know cmdcreate

I highly recommend checking out The File Structure of cmdcreate. Get familiar with the project layout before making changes.