Skip to content

Commit

Permalink
chore: rename copier -> cp (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmzane authored Mar 29, 2024
1 parent 7084046 commit b5b7ed3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ go get go-simpler.org/assert
> [!tip]
> When developing a library, you may want to keep `go.mod` small (or, even better, empty).
> In such cases, it is recommended to just copy-paste `assert`, as it is tiny and rarely updated.
> See the `cmd/copier` helper to do this automatically.
> See the `cmd/cp` utility to do this automatically.
## 📋 Usage

Expand Down
11 changes: 6 additions & 5 deletions cmd/copier/main.go → cmd/cp/main.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
//go:build copier
//go:build cp

// Copier is a convenience tool that copies the assertions into a project,
// so that they can be used without introducing a direct dependency.
// Cp is a utility to copy [assert] for use without introducing a direct dependency.
//
// Usage: //go:generate go run -tags=copier go-simpler.org/assert/cmd/copier@<version> [-dir=<working-directory>]
// Usage:
// 1. Add //go:generate go run -tags=cp go-simpler.org/assert/cmd/cp@<version> [-dir=<working-directory>]
// 2. Run go generate ./...
package main

import (
Expand Down Expand Up @@ -98,7 +99,7 @@ func writeFile(path, content string) error {
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
// Code generated by go-simpler.org/assert/cmd/copier. DO NOT EDIT.
// Code generated by go-simpler.org/assert/cmd/cp. DO NOT EDIT.
`
return os.WriteFile(path, []byte(header+content), 0644)
Expand Down
3 changes: 1 addition & 2 deletions embed.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
//go:build copier
//go:build cp

package assert

import _ "embed"

// These files are used by the cmd/copier tool. Ignore them.
var (
//go:embed assert.go
MainFile string
Expand Down

0 comments on commit b5b7ed3

Please sign in to comment.