This document describes how to modify and customize squIRCy2, and optionally contribute your changes back to the original squIRCy2 codebase.
The master branch contains active development. It should be considered unstable. Versions are tagged in the repository.
squIRCy2 is made up of a few different parts:
cli.gofor the CLI related code.
web/controller.gofor code related to all controller actions.
event/, a wrapper for go-ircevent in
irc/, and an overall “manager” that embeds an inject.Injector in
Fork the squIRCy2 repository on GitHub.
git clone [email protected]/you/squircy2.git squircy2
There are two options for building squIRCy2: default (release) and debug. Debug mode is recommended for development.
Building squIRCy2 in debug mode makes it so that changes to views and static assets do not require a rebuilding of the squIRCy2 code.
go build -tags debug -o squircy2 ./cmd/squircy2/...
Alternatively, you can run squIRCy2 with
go run -tags debug ./cmd/squircy2/main.go
Note: When running in debug mode, squIRCy2 will look in the current working directory for views and assets. Specifically, views must be in
$PWD/viewsand static assets in
Building squIRCy2 for release takes two steps. First, we have to convert our assets and views into binary form. This relies on the go-bindata utility which is installed along-side squIRCy2 and must be in your PATH.
go build -o squircy2 ./cmd/squircy2/*.go
go build -o squircy2 -ldflags "-X main.Version=$(git rev-parse --short HEAD)" ./cmd/squircy2/*.go
With squIRCy forked and set up for development, you’re ready to get started. Depending on how you’re building squIRCy, you may need to do different things to see your changes take effect.
Modifying Go source code will always require that you stop the currently running squIRCy2 process, then running
go build && ./squircy2 or
go run main.go to rebuild the binary and run it.
When running in debug mode, modifying assets requires a refresh in your browser. However, if you’re running in default (release) mode, then you will have to run
go generate ./... before rebuilding and running the squIRCy2 binary.
If you’d like to create a new feature or fix a bug and contribute your modification to the original repository, follow these steps.
git checkout -b new-and-awesome master
This will checkout a new branch named
new-and-awesome based on the current master branch.
git add .
git commit -m "Made some changes"
git push origin new-and-awesome
From your repository on the GitHub interface, click the pull request button. Select your feature branch and ensure the master branch of squIRCy2 is selected.