1.6 KiB
Hacking
The following is a quickstart guide for developing cheat
.
1. Install system dependencies
Before you begin, you must install a handful of system dependencies. The
following are required, and must be available on your PATH
:
git
go
(>= 1.17 is recommended)make
The following dependencies are optional:
docker
pandoc
(necessary to generate aman
page)
2. Install utility applications
Run make setup
to install scc
and revive
, which are used by various
make
targets.
3. Development workflow
After your environment has been configured, your development workflow will resemble the following:
- Make changes to the
cheat
source code. - Run
make test
to run unit-tests. - Fix compiler errors and failing tests as necessary.
- Run
make
. Acheat
executable will be written to thedist
directory. - Use the new executable by running
dist/cheat <command>
. - Run
make install
to installcheat
to yourPATH
. - Run
make build-release
to build cross-platform binaries indist
. - Run
make clean
to clean thedist
directory when desired.
You may run make help
to see a list of available make
commands.
Developing with docker
It may be useful to test your changes within a pristine environment. An Alpine-based docker container has been provided for that purpose.
If you would like to build the docker container, run:
make docker-setup
To shell into the container, run:
make docker-sh
The cheat
source code will be mounted at /app
within the container.
If you would like to destroy this container, you may run:
make distclean