Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: rename copier -> cp #16

Merged
merged 1 commit into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading