diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..1b6bdf5 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,51 @@ +# Contributing to ch + +## Development + +### Adding New Commands + +Install cobra dependencies: (required to generate new commands) + +```shell script +go get github.com/spf13/cobra/cobra +``` + +Add new cobra command + +```shell script +# add new subcommand +cobra add -p +cobra add childCommand -p 'parentCommand' +``` + +Add or adjust `~/.cobra.yaml` file for your name, license, year, etc. [Docs](https://github.com/spf13/cobra/blob/master/cobra/README.md) + +### Working with Go Modules + +Go Module: + +```shell script +# you don't have to run this since we already have a go.mod and go.sum file +go mod init github.com// + +# add new library +go get + +# organize modules and dependencies +go mod tidy + +# remove dependency +go mod edit -dropreplace github.com/go-chi/chi +``` + +## Documentation + +When writing instructions in the CLI and in the README, please follow syntax recommended by [google developer docs](https://developers.google.com/style/code-syntax) + + +Change package name: + +```shell script +# change module name in all files + find . -type f \( -name '*.go' -o -name '*.mod' \) -exec sed -i -e "s;container-helper;ch;g" {} + +``` diff --git a/README.md b/README.md index 955122c..0d532e4 100644 --- a/README.md +++ b/README.md @@ -98,49 +98,3 @@ stop running container/environment ### list list all saved configs - -## Development - -Install cobra dependencies: (required to generate new commands) - -```shell script -go get github.com/spf13/cobra/cobra -``` - -Add new cobra command - -```shell script -# add new subcommand -cobra add -p -cobra add childCommand -p 'parentCommand' -``` - -Add or adjust `~/.cobra.yaml` file for your name, license, year, etc. [Docs](https://github.com/spf13/cobra/blob/master/cobra/README.md) - -Go Module: - -```shell script -# already created -go mod init github.com// - -# add new library -go get - -# organize modules and dependencies -go mod tidy - -# remove dependency -go mod edit -dropreplace github.com/go-chi/chi -``` - -Write Documentation: - -Follow syntax recommended by [google developer docs](https://developers.google.com/style/code-syntax) - - -Change package name: - -```shell script -# change module name in all files - find . -type f \( -name '*.go' -o -name '*.mod' \) -exec sed -i -e "s;container-helper;ch;g" {} + -```