Skip to content

Commit

Permalink
Organize markdown files
Browse files Browse the repository at this point in the history
  • Loading branch information
camerondurham committed Jan 12, 2021
1 parent ab3e74a commit 77cc214
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 46 deletions.
51 changes: 51 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -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 <child command> -p <parent command>
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/<name>/<repo-name>

# add new library
go get <new dependency>

# 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" {} +
```
46 changes: 0 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <child command> -p <parent command>
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/<name>/<repo-name>

# add new library
go get <new dependency>

# 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" {} +
```

0 comments on commit 77cc214

Please sign in to comment.