diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 69e9461c748..39b0bf4a1c2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -167,7 +167,7 @@ jobs: with: scandir: ./assets/scripts - name: Whitespace - run: go run ./internal/cmd/lint-whitespace + run: go run ./internal/cmds/lint-whitespace - name: Typos run: | go install github.com/twpayne/findtypos@latest diff --git a/.golangci.yml b/.golangci.yml index 89bcd4a614d..6e7c261d5b4 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -96,7 +96,7 @@ issues: - linters: - forbidigo - gosec - path: ^internal/cmd/ + path: ^internal/cmds/ - linters: - gosec path: "_test\\.go$" diff --git a/Makefile b/Makefile index 1a6743a1ca9..4ecec6bcd8b 100644 --- a/Makefile +++ b/Makefile @@ -48,13 +48,13 @@ completions: $(GO) run . completion powershell -o completions/chezmoi.ps1 $(GO) run . completion zsh -o completions/chezmoi.zsh -assets/scripts/install.sh: internal/cmd/generate-install.sh/install.sh.tmpl internal/cmd/generate-install.sh/main.go - $(GO) run ./internal/cmd/generate-install.sh > $@ +assets/scripts/install.sh: internal/cmds/generate-install.sh/install.sh.tmpl internal/cmds/generate-install.sh/main.go + $(GO) run ./internal/cmds/generate-install.sh > $@ .PHONY: lint lint: ensure-golangci-lint ./bin/golangci-lint run - $(GO) run ./internal/cmd/lint-whitespace + $(GO) run ./internal/cmds/lint-whitespace .PHONY: format format: ensure-gofumports diff --git a/chezmoi.io/Makefile b/chezmoi.io/Makefile index 336275803bc..c0e502fe1b0 100644 --- a/chezmoi.io/Makefile +++ b/chezmoi.io/Makefile @@ -17,38 +17,38 @@ content-docs: \ content/docs/related.md \ content/docs/templating.md -content/docs/architecture.md: ../docs/ARCHITECTURE.md ../internal/cmd/generate-chezmoi.io-content-docs/main.go Makefile - go run ../internal/cmd/generate-chezmoi.io-content-docs -shorttitle="Architecture" -longtitle="Architecture" < $< > $@ || ( rm -f $@ ; false ) +content/docs/architecture.md: ../docs/ARCHITECTURE.md ../internal/cmds/generate-chezmoi.io-content-docs/main.go Makefile + go run ../internal/cmds/generate-chezmoi.io-content-docs -shorttitle="Architecture" -longtitle="Architecture" < $< > $@ || ( rm -f $@ ; false ) -content/docs/changes.md: ../docs/CHANGES.md ../internal/cmd/generate-chezmoi.io-content-docs/main.go Makefile - go run ../internal/cmd/generate-chezmoi.io-content-docs -shorttitle="Changes" -longtitle="Changes" < $< > $@ || ( rm -f $@ ; false ) +content/docs/changes.md: ../docs/CHANGES.md ../internal/cmds/generate-chezmoi.io-content-docs/main.go Makefile + go run ../internal/cmds/generate-chezmoi.io-content-docs -shorttitle="Changes" -longtitle="Changes" < $< > $@ || ( rm -f $@ ; false ) -content/docs/comparison.md: ../docs/COMPARISON.md ../internal/cmd/generate-chezmoi.io-content-docs/main.go Makefile - go run ../internal/cmd/generate-chezmoi.io-content-docs -shorttitle="Comparison" -longtitle="Comparison Guide" < $< > $@ || ( rm -f $@ ; false ) +content/docs/comparison.md: ../docs/COMPARISON.md ../internal/cmds/generate-chezmoi.io-content-docs/main.go Makefile + go run ../internal/cmds/generate-chezmoi.io-content-docs -shorttitle="Comparison" -longtitle="Comparison Guide" < $< > $@ || ( rm -f $@ ; false ) -content/docs/contributing.md: ../docs/CONTRIBUTING.md ../internal/cmd/generate-chezmoi.io-content-docs/main.go Makefile - go run ../internal/cmd/generate-chezmoi.io-content-docs -shorttitle="Contributing" -longtitle="Contributing Guide" < $< > $@ || ( rm -f $@ ; false ) +content/docs/contributing.md: ../docs/CONTRIBUTING.md ../internal/cmds/generate-chezmoi.io-content-docs/main.go Makefile + go run ../internal/cmds/generate-chezmoi.io-content-docs -shorttitle="Contributing" -longtitle="Contributing Guide" < $< > $@ || ( rm -f $@ ; false ) -content/docs/faq.md: ../docs/FAQ.md ../internal/cmd/generate-chezmoi.io-content-docs/main.go Makefile - go run ../internal/cmd/generate-chezmoi.io-content-docs -shorttitle="FAQ" -longtitle="Frequently Asked Questions" < $< > $@ || ( rm -f $@ ; false ) +content/docs/faq.md: ../docs/FAQ.md ../internal/cmds/generate-chezmoi.io-content-docs/main.go Makefile + go run ../internal/cmds/generate-chezmoi.io-content-docs -shorttitle="FAQ" -longtitle="Frequently Asked Questions" < $< > $@ || ( rm -f $@ ; false ) -content/docs/how-to.md: ../docs/HOWTO.md ../internal/cmd/generate-chezmoi.io-content-docs/main.go Makefile - go run ../internal/cmd/generate-chezmoi.io-content-docs -shorttitle="How-To" -longtitle="How-To Guide" < $< > $@ || ( rm -f $@ ; false ) +content/docs/how-to.md: ../docs/HOWTO.md ../internal/cmds/generate-chezmoi.io-content-docs/main.go Makefile + go run ../internal/cmds/generate-chezmoi.io-content-docs -shorttitle="How-To" -longtitle="How-To Guide" < $< > $@ || ( rm -f $@ ; false ) -content/docs/install.md: ../docs/INSTALL.md ../internal/cmd/generate-chezmoi.io-content-docs/main.go Makefile - go run ../internal/cmd/generate-chezmoi.io-content-docs -shorttitle="Install" -longtitle="Install Guide" < $< > $@ || ( rm -f $@ ; false ) +content/docs/install.md: ../docs/INSTALL.md ../internal/cmds/generate-chezmoi.io-content-docs/main.go Makefile + go run ../internal/cmds/generate-chezmoi.io-content-docs -shorttitle="Install" -longtitle="Install Guide" < $< > $@ || ( rm -f $@ ; false ) -content/docs/media.md: ../docs/MEDIA.md ../internal/cmd/generate-chezmoi.io-content-docs/main.go Makefile - go run ../internal/cmd/generate-chezmoi.io-content-docs -shorttitle="Media" -longtitle="Media" < $< > $@ || ( rm -f $@ ; false ) +content/docs/media.md: ../docs/MEDIA.md ../internal/cmds/generate-chezmoi.io-content-docs/main.go Makefile + go run ../internal/cmds/generate-chezmoi.io-content-docs -shorttitle="Media" -longtitle="Media" < $< > $@ || ( rm -f $@ ; false ) -content/docs/quick-start.md: ../docs/QUICKSTART.md ../internal/cmd/generate-chezmoi.io-content-docs/main.go Makefile - go run ../internal/cmd/generate-chezmoi.io-content-docs -shorttitle="Quick Start" -longtitle="Quick Start Guide" < $< > $@ || ( rm -f $@ ; false ) +content/docs/quick-start.md: ../docs/QUICKSTART.md ../internal/cmds/generate-chezmoi.io-content-docs/main.go Makefile + go run ../internal/cmds/generate-chezmoi.io-content-docs -shorttitle="Quick Start" -longtitle="Quick Start Guide" < $< > $@ || ( rm -f $@ ; false ) -content/docs/reference.md: ../docs/REFERENCE.md ../internal/cmd/generate-chezmoi.io-content-docs/main.go Makefile - go run ../internal/cmd/generate-chezmoi.io-content-docs -shorttitle="Reference" -longtitle="Reference Manual" < $< > $@ || ( rm -f $@ ; false ) +content/docs/reference.md: ../docs/REFERENCE.md ../internal/cmds/generate-chezmoi.io-content-docs/main.go Makefile + go run ../internal/cmds/generate-chezmoi.io-content-docs -shorttitle="Reference" -longtitle="Reference Manual" < $< > $@ || ( rm -f $@ ; false ) -content/docs/related.md: ../docs/RELATED.md ../internal/cmd/generate-chezmoi.io-content-docs/main.go Makefile - go run ../internal/cmd/generate-chezmoi.io-content-docs -shorttitle="Related" -longtitle="Related Software" < $< > $@ || ( rm -f $@ ; false ) +content/docs/related.md: ../docs/RELATED.md ../internal/cmds/generate-chezmoi.io-content-docs/main.go Makefile + go run ../internal/cmds/generate-chezmoi.io-content-docs -shorttitle="Related" -longtitle="Related Software" < $< > $@ || ( rm -f $@ ; false ) -content/docs/templating.md: ../docs/TEMPLATING.md ../internal/cmd/generate-chezmoi.io-content-docs/main.go Makefile - go run ../internal/cmd/generate-chezmoi.io-content-docs -shorttitle="Templating" -longtitle="Templating Guide" < $< > $@ || ( rm -f $@ ; false ) +content/docs/templating.md: ../docs/TEMPLATING.md ../internal/cmds/generate-chezmoi.io-content-docs/main.go Makefile + go run ../internal/cmds/generate-chezmoi.io-content-docs -shorttitle="Templating" -longtitle="Templating Guide" < $< > $@ || ( rm -f $@ ; false ) diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index bfbbc48f182..962019bee42 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -34,10 +34,10 @@ The important directories in chezmoi are: | Directory | Contents | | --------- | -------- | -| `cmd/` | Code for the `chezmoi` command. | | `docs/` | The documentation single source of truth. Help text, examples, and the [chezmoi.io](https://chezmoi.io) website are generated from the files in this directory, particularly `docs/REFERENCE.md`. | | `internal/chezmoi/` | chezmoi's core functionality. | -| `testdata/scripts/` | High-level tests of chezmoi's commands using [`testscript`](https://pkg.go.dev/github.com/rogpeppe/go-internal/testscript). | +| `internal/cmd/` | Code for the `chezmoi` command. | +| `internal/cmd/testdata/scripts/` | High-level tests of chezmoi's commands using [`testscript`](https://pkg.go.dev/github.com/rogpeppe/go-internal/testscript). | ## Key concepts @@ -111,10 +111,10 @@ persistent state. chezmoi can then detect if a third party has updated a target since chezmoi last wrote it by comparing the actual state entry in the target state with the entry state in the persistent state. -## `cmd/` +## `internal/cmd/` -`cmd/*cmd.go` contains the code for each individual command and -`cmd/*templatefuncs.go` contain the template functions. +`internal/cmd/*cmd.go` contains the code for each individual command and +`internal/cmd/*templatefuncs.go` contain the template functions. Commands are defined as methods on the `Config` struct. The `Config` struct is large, containing all configuration values read from the config file, command diff --git a/cmd/addcmd.go b/internal/cmd/addcmd.go similarity index 100% rename from cmd/addcmd.go rename to internal/cmd/addcmd.go diff --git a/cmd/addcmd_test.go b/internal/cmd/addcmd_test.go similarity index 100% rename from cmd/addcmd_test.go rename to internal/cmd/addcmd_test.go diff --git a/cmd/applycmd.go b/internal/cmd/applycmd.go similarity index 100% rename from cmd/applycmd.go rename to internal/cmd/applycmd.go diff --git a/cmd/applycmd_test.go b/internal/cmd/applycmd_test.go similarity index 100% rename from cmd/applycmd_test.go rename to internal/cmd/applycmd_test.go diff --git a/cmd/archivecmd.go b/internal/cmd/archivecmd.go similarity index 100% rename from cmd/archivecmd.go rename to internal/cmd/archivecmd.go diff --git a/cmd/autobool.go b/internal/cmd/autobool.go similarity index 100% rename from cmd/autobool.go rename to internal/cmd/autobool.go diff --git a/cmd/bitwardentemplatefuncs.go b/internal/cmd/bitwardentemplatefuncs.go similarity index 100% rename from cmd/bitwardentemplatefuncs.go rename to internal/cmd/bitwardentemplatefuncs.go diff --git a/cmd/catcmd.go b/internal/cmd/catcmd.go similarity index 100% rename from cmd/catcmd.go rename to internal/cmd/catcmd.go diff --git a/cmd/cdcmd.go b/internal/cmd/cdcmd.go similarity index 100% rename from cmd/cdcmd.go rename to internal/cmd/cdcmd.go diff --git a/cmd/chattrcmd.go b/internal/cmd/chattrcmd.go similarity index 100% rename from cmd/chattrcmd.go rename to internal/cmd/chattrcmd.go diff --git a/cmd/chattrcmd_test.go b/internal/cmd/chattrcmd_test.go similarity index 100% rename from cmd/chattrcmd_test.go rename to internal/cmd/chattrcmd_test.go diff --git a/cmd/cmd.go b/internal/cmd/cmd.go similarity index 100% rename from cmd/cmd.go rename to internal/cmd/cmd.go diff --git a/cmd/cmd_test.go b/internal/cmd/cmd_test.go similarity index 100% rename from cmd/cmd_test.go rename to internal/cmd/cmd_test.go diff --git a/cmd/completioncmd.go b/internal/cmd/completioncmd.go similarity index 100% rename from cmd/completioncmd.go rename to internal/cmd/completioncmd.go diff --git a/cmd/config.go b/internal/cmd/config.go similarity index 100% rename from cmd/config.go rename to internal/cmd/config.go diff --git a/cmd/config_test.go b/internal/cmd/config_test.go similarity index 100% rename from cmd/config_test.go rename to internal/cmd/config_test.go diff --git a/cmd/datacmd.go b/internal/cmd/datacmd.go similarity index 100% rename from cmd/datacmd.go rename to internal/cmd/datacmd.go diff --git a/cmd/datacmd_test.go b/internal/cmd/datacmd_test.go similarity index 100% rename from cmd/datacmd_test.go rename to internal/cmd/datacmd_test.go diff --git a/cmd/dataformat.go b/internal/cmd/dataformat.go similarity index 100% rename from cmd/dataformat.go rename to internal/cmd/dataformat.go diff --git a/cmd/diffcmd.go b/internal/cmd/diffcmd.go similarity index 100% rename from cmd/diffcmd.go rename to internal/cmd/diffcmd.go diff --git a/cmd/diffcmd_test.go b/internal/cmd/diffcmd_test.go similarity index 100% rename from cmd/diffcmd_test.go rename to internal/cmd/diffcmd_test.go diff --git a/cmd/docscmd.go b/internal/cmd/docscmd.go similarity index 100% rename from cmd/docscmd.go rename to internal/cmd/docscmd.go diff --git a/cmd/doctorcmd.go b/internal/cmd/doctorcmd.go similarity index 100% rename from cmd/doctorcmd.go rename to internal/cmd/doctorcmd.go diff --git a/cmd/dumpcmd.go b/internal/cmd/dumpcmd.go similarity index 100% rename from cmd/dumpcmd.go rename to internal/cmd/dumpcmd.go diff --git a/cmd/editcmd.go b/internal/cmd/editcmd.go similarity index 100% rename from cmd/editcmd.go rename to internal/cmd/editcmd.go diff --git a/cmd/editconfigcmd.go b/internal/cmd/editconfigcmd.go similarity index 100% rename from cmd/editconfigcmd.go rename to internal/cmd/editconfigcmd.go diff --git a/cmd/executetemplatecmd.go b/internal/cmd/executetemplatecmd.go similarity index 100% rename from cmd/executetemplatecmd.go rename to internal/cmd/executetemplatecmd.go diff --git a/cmd/forgetcmd.go b/internal/cmd/forgetcmd.go similarity index 100% rename from cmd/forgetcmd.go rename to internal/cmd/forgetcmd.go diff --git a/cmd/gitcmd.go b/internal/cmd/gitcmd.go similarity index 100% rename from cmd/gitcmd.go rename to internal/cmd/gitcmd.go diff --git a/cmd/githubtemplatefuncs.go b/internal/cmd/githubtemplatefuncs.go similarity index 100% rename from cmd/githubtemplatefuncs.go rename to internal/cmd/githubtemplatefuncs.go diff --git a/cmd/gopasstemplatefuncs.go b/internal/cmd/gopasstemplatefuncs.go similarity index 100% rename from cmd/gopasstemplatefuncs.go rename to internal/cmd/gopasstemplatefuncs.go diff --git a/cmd/helpcmd.go b/internal/cmd/helpcmd.go similarity index 100% rename from cmd/helpcmd.go rename to internal/cmd/helpcmd.go diff --git a/cmd/importcmd.go b/internal/cmd/importcmd.go similarity index 100% rename from cmd/importcmd.go rename to internal/cmd/importcmd.go diff --git a/cmd/importcmd_test.go b/internal/cmd/importcmd_test.go similarity index 100% rename from cmd/importcmd_test.go rename to internal/cmd/importcmd_test.go diff --git a/cmd/initcmd.go b/internal/cmd/initcmd.go similarity index 100% rename from cmd/initcmd.go rename to internal/cmd/initcmd.go diff --git a/cmd/initcmd_test.go b/internal/cmd/initcmd_test.go similarity index 100% rename from cmd/initcmd_test.go rename to internal/cmd/initcmd_test.go diff --git a/cmd/keepassxctemplatefuncs.go b/internal/cmd/keepassxctemplatefuncs.go similarity index 100% rename from cmd/keepassxctemplatefuncs.go rename to internal/cmd/keepassxctemplatefuncs.go diff --git a/cmd/keyringtemplatefuncs.go b/internal/cmd/keyringtemplatefuncs.go similarity index 100% rename from cmd/keyringtemplatefuncs.go rename to internal/cmd/keyringtemplatefuncs.go diff --git a/cmd/lastpasstemplatefuncs.go b/internal/cmd/lastpasstemplatefuncs.go similarity index 100% rename from cmd/lastpasstemplatefuncs.go rename to internal/cmd/lastpasstemplatefuncs.go diff --git a/cmd/lastpasstemplatefuncs_test.go b/internal/cmd/lastpasstemplatefuncs_test.go similarity index 100% rename from cmd/lastpasstemplatefuncs_test.go rename to internal/cmd/lastpasstemplatefuncs_test.go diff --git a/main_test.go b/internal/cmd/main_test.go similarity index 98% rename from main_test.go rename to internal/cmd/main_test.go index 5e339d4a61c..4e65262d004 100644 --- a/main_test.go +++ b/internal/cmd/main_test.go @@ -1,4 +1,4 @@ -package main +package cmd_test import ( "bufio" @@ -20,8 +20,8 @@ import ( "github.com/twpayne/go-vfs/v3" "github.com/twpayne/go-vfs/v3/vfst" - "github.com/twpayne/chezmoi/v2/cmd" "github.com/twpayne/chezmoi/v2/internal/chezmoitest" + "github.com/twpayne/chezmoi/v2/internal/cmd" ) var umaskConditionRx = regexp.MustCompile(`\Aumask:([0-7]{3})\z`) @@ -275,9 +275,9 @@ func cmdMkGPGConfig(ts *testscript.TestScript, neg bool, args []string) { `encryption = "gpg"`, `[gpg]`, ` args = [`, - ` "--homedir", ` + quote(gpgHomeDir) + `,`, + ` "--homedir", ` + strconv.Quote(gpgHomeDir) + `,`, ` "--no-tty",`, - ` "--passphrase", ` + quote(passphrase) + `,`, + ` "--passphrase", ` + strconv.Quote(passphrase) + `,`, ` "--pinentry-mode", "loopback",`, ` ]`, } @@ -446,10 +446,6 @@ func prependDirToPath(dir, path string) string { return strings.Join(append([]string{dir}, filepath.SplitList(path)...), string(os.PathListSeparator)) } -func quote(s string) string { - return fmt.Sprintf("%q", s) -} - func setup(env *testscript.Env) error { var ( binDir = filepath.Join(env.WorkDir, "bin") diff --git a/cmd/managedcmd.go b/internal/cmd/managedcmd.go similarity index 100% rename from cmd/managedcmd.go rename to internal/cmd/managedcmd.go diff --git a/cmd/managedcmd_test.go b/internal/cmd/managedcmd_test.go similarity index 100% rename from cmd/managedcmd_test.go rename to internal/cmd/managedcmd_test.go diff --git a/cmd/mergecmd.go b/internal/cmd/mergecmd.go similarity index 100% rename from cmd/mergecmd.go rename to internal/cmd/mergecmd.go diff --git a/cmd/noupgradecmd.go b/internal/cmd/noupgradecmd.go similarity index 100% rename from cmd/noupgradecmd.go rename to internal/cmd/noupgradecmd.go diff --git a/cmd/onepasswordtemplatefuncs.go b/internal/cmd/onepasswordtemplatefuncs.go similarity index 100% rename from cmd/onepasswordtemplatefuncs.go rename to internal/cmd/onepasswordtemplatefuncs.go diff --git a/cmd/passtemplatefuncs.go b/internal/cmd/passtemplatefuncs.go similarity index 100% rename from cmd/passtemplatefuncs.go rename to internal/cmd/passtemplatefuncs.go diff --git a/cmd/purgecmd.go b/internal/cmd/purgecmd.go similarity index 100% rename from cmd/purgecmd.go rename to internal/cmd/purgecmd.go diff --git a/cmd/readdcmd.go b/internal/cmd/readdcmd.go similarity index 100% rename from cmd/readdcmd.go rename to internal/cmd/readdcmd.go diff --git a/cmd/removecmd.go b/internal/cmd/removecmd.go similarity index 100% rename from cmd/removecmd.go rename to internal/cmd/removecmd.go diff --git a/cmd/secretcmd.go b/internal/cmd/secretcmd.go similarity index 100% rename from cmd/secretcmd.go rename to internal/cmd/secretcmd.go diff --git a/cmd/secretkeyringcmd.go b/internal/cmd/secretkeyringcmd.go similarity index 100% rename from cmd/secretkeyringcmd.go rename to internal/cmd/secretkeyringcmd.go diff --git a/cmd/secrettemplatefuncs.go b/internal/cmd/secrettemplatefuncs.go similarity index 100% rename from cmd/secrettemplatefuncs.go rename to internal/cmd/secrettemplatefuncs.go diff --git a/cmd/sourcepathcmd.go b/internal/cmd/sourcepathcmd.go similarity index 100% rename from cmd/sourcepathcmd.go rename to internal/cmd/sourcepathcmd.go diff --git a/cmd/statecmd.go b/internal/cmd/statecmd.go similarity index 100% rename from cmd/statecmd.go rename to internal/cmd/statecmd.go diff --git a/cmd/statuscmd.go b/internal/cmd/statuscmd.go similarity index 100% rename from cmd/statuscmd.go rename to internal/cmd/statuscmd.go diff --git a/cmd/statuscmd_test.go b/internal/cmd/statuscmd_test.go similarity index 100% rename from cmd/statuscmd_test.go rename to internal/cmd/statuscmd_test.go diff --git a/cmd/templatefuncs.go b/internal/cmd/templatefuncs.go similarity index 100% rename from cmd/templatefuncs.go rename to internal/cmd/templatefuncs.go diff --git a/cmd/terminal.go b/internal/cmd/terminal.go similarity index 100% rename from cmd/terminal.go rename to internal/cmd/terminal.go diff --git a/testdata/scripts/add.txt b/internal/cmd/testdata/scripts/add.txt similarity index 96% rename from testdata/scripts/add.txt rename to internal/cmd/testdata/scripts/add.txt index 12e7df3f1c2..aa2892d8589 100644 --- a/testdata/scripts/add.txt +++ b/internal/cmd/testdata/scripts/add.txt @@ -36,7 +36,7 @@ chezmoi add $HOME${/}.symlink cmp $CHEZMOISOURCEDIR/symlink_dot_symlink golden/symlink_dot_symlink # test adding a symlink with a separator -symlink $HOME${/}.symlink2 -> .dir${/}subdir${/}file +symlink $HOME/.symlink2 -> .dir/subdir/file chezmoi add $HOME${/}.symlink2 cmp $CHEZMOISOURCEDIR/symlink_dot_symlink2 golden/symlink_dot_symlink diff --git a/testdata/scripts/addattributes.txt b/internal/cmd/testdata/scripts/addattributes.txt similarity index 100% rename from testdata/scripts/addattributes.txt rename to internal/cmd/testdata/scripts/addattributes.txt diff --git a/testdata/scripts/addautotemplate.txt b/internal/cmd/testdata/scripts/addautotemplate.txt similarity index 100% rename from testdata/scripts/addautotemplate.txt rename to internal/cmd/testdata/scripts/addautotemplate.txt diff --git a/testdata/scripts/addencrypted.txt b/internal/cmd/testdata/scripts/addencrypted.txt similarity index 100% rename from testdata/scripts/addencrypted.txt rename to internal/cmd/testdata/scripts/addencrypted.txt diff --git a/testdata/scripts/ageencryption.txt b/internal/cmd/testdata/scripts/ageencryption.txt similarity index 100% rename from testdata/scripts/ageencryption.txt rename to internal/cmd/testdata/scripts/ageencryption.txt diff --git a/testdata/scripts/apply.txt b/internal/cmd/testdata/scripts/apply.txt similarity index 100% rename from testdata/scripts/apply.txt rename to internal/cmd/testdata/scripts/apply.txt diff --git a/testdata/scripts/applychmod.txt b/internal/cmd/testdata/scripts/applychmod.txt similarity index 93% rename from testdata/scripts/applychmod.txt rename to internal/cmd/testdata/scripts/applychmod.txt index f6f82a30612..36cc0f442f5 100644 --- a/testdata/scripts/applychmod.txt +++ b/internal/cmd/testdata/scripts/applychmod.txt @@ -5,7 +5,7 @@ mkhomedir mksourcedir # test change file mode -chmod 777 $HOME${/}.file +chmod 777 $HOME/.file chezmoi apply --force cmpmod 666 $HOME/.file diff --git a/testdata/scripts/applyexact.txt b/internal/cmd/testdata/scripts/applyexact.txt similarity index 100% rename from testdata/scripts/applyexact.txt rename to internal/cmd/testdata/scripts/applyexact.txt diff --git a/testdata/scripts/applyremove.txt b/internal/cmd/testdata/scripts/applyremove.txt similarity index 100% rename from testdata/scripts/applyremove.txt rename to internal/cmd/testdata/scripts/applyremove.txt diff --git a/testdata/scripts/applyskipencrypted.txt b/internal/cmd/testdata/scripts/applyskipencrypted.txt similarity index 100% rename from testdata/scripts/applyskipencrypted.txt rename to internal/cmd/testdata/scripts/applyskipencrypted.txt diff --git a/testdata/scripts/applysourcepath.txt b/internal/cmd/testdata/scripts/applysourcepath.txt similarity index 100% rename from testdata/scripts/applysourcepath.txt rename to internal/cmd/testdata/scripts/applysourcepath.txt diff --git a/testdata/scripts/applystate.txt b/internal/cmd/testdata/scripts/applystate.txt similarity index 100% rename from testdata/scripts/applystate.txt rename to internal/cmd/testdata/scripts/applystate.txt diff --git a/testdata/scripts/applytype.txt b/internal/cmd/testdata/scripts/applytype.txt similarity index 100% rename from testdata/scripts/applytype.txt rename to internal/cmd/testdata/scripts/applytype.txt diff --git a/testdata/scripts/archivetar.txt b/internal/cmd/testdata/scripts/archivetar.txt similarity index 100% rename from testdata/scripts/archivetar.txt rename to internal/cmd/testdata/scripts/archivetar.txt diff --git a/testdata/scripts/archivezip.txt b/internal/cmd/testdata/scripts/archivezip.txt similarity index 100% rename from testdata/scripts/archivezip.txt rename to internal/cmd/testdata/scripts/archivezip.txt diff --git a/testdata/scripts/autocommit.txt b/internal/cmd/testdata/scripts/autocommit.txt similarity index 100% rename from testdata/scripts/autocommit.txt rename to internal/cmd/testdata/scripts/autocommit.txt diff --git a/testdata/scripts/autopush.txt b/internal/cmd/testdata/scripts/autopush.txt similarity index 100% rename from testdata/scripts/autopush.txt rename to internal/cmd/testdata/scripts/autopush.txt diff --git a/testdata/scripts/bitwarden.txt b/internal/cmd/testdata/scripts/bitwarden.txt similarity index 100% rename from testdata/scripts/bitwarden.txt rename to internal/cmd/testdata/scripts/bitwarden.txt diff --git a/testdata/scripts/builtingit.txt b/internal/cmd/testdata/scripts/builtingit.txt similarity index 100% rename from testdata/scripts/builtingit.txt rename to internal/cmd/testdata/scripts/builtingit.txt diff --git a/testdata/scripts/cat.txt b/internal/cmd/testdata/scripts/cat.txt similarity index 100% rename from testdata/scripts/cat.txt rename to internal/cmd/testdata/scripts/cat.txt diff --git a/testdata/scripts/cd_unix.txt b/internal/cmd/testdata/scripts/cd_unix.txt similarity index 100% rename from testdata/scripts/cd_unix.txt rename to internal/cmd/testdata/scripts/cd_unix.txt diff --git a/testdata/scripts/cd_windows.txt b/internal/cmd/testdata/scripts/cd_windows.txt similarity index 100% rename from testdata/scripts/cd_windows.txt rename to internal/cmd/testdata/scripts/cd_windows.txt diff --git a/testdata/scripts/chattr.txt b/internal/cmd/testdata/scripts/chattr.txt similarity index 100% rename from testdata/scripts/chattr.txt rename to internal/cmd/testdata/scripts/chattr.txt diff --git a/testdata/scripts/completion.txt b/internal/cmd/testdata/scripts/completion.txt similarity index 100% rename from testdata/scripts/completion.txt rename to internal/cmd/testdata/scripts/completion.txt diff --git a/testdata/scripts/config.txt b/internal/cmd/testdata/scripts/config.txt similarity index 100% rename from testdata/scripts/config.txt rename to internal/cmd/testdata/scripts/config.txt diff --git a/testdata/scripts/configstate.txt b/internal/cmd/testdata/scripts/configstate.txt similarity index 100% rename from testdata/scripts/configstate.txt rename to internal/cmd/testdata/scripts/configstate.txt diff --git a/testdata/scripts/data.txt b/internal/cmd/testdata/scripts/data.txt similarity index 100% rename from testdata/scripts/data.txt rename to internal/cmd/testdata/scripts/data.txt diff --git a/testdata/scripts/diff.txt b/internal/cmd/testdata/scripts/diff.txt similarity index 100% rename from testdata/scripts/diff.txt rename to internal/cmd/testdata/scripts/diff.txt diff --git a/testdata/scripts/docs.txt b/internal/cmd/testdata/scripts/docs.txt similarity index 100% rename from testdata/scripts/docs.txt rename to internal/cmd/testdata/scripts/docs.txt diff --git a/testdata/scripts/doctor.txt b/internal/cmd/testdata/scripts/doctor.txt similarity index 100% rename from testdata/scripts/doctor.txt rename to internal/cmd/testdata/scripts/doctor.txt diff --git a/testdata/scripts/dumpjson.txt b/internal/cmd/testdata/scripts/dumpjson.txt similarity index 100% rename from testdata/scripts/dumpjson.txt rename to internal/cmd/testdata/scripts/dumpjson.txt diff --git a/testdata/scripts/dumpyaml.txt b/internal/cmd/testdata/scripts/dumpyaml.txt similarity index 100% rename from testdata/scripts/dumpyaml.txt rename to internal/cmd/testdata/scripts/dumpyaml.txt diff --git a/testdata/scripts/edgecases.txt b/internal/cmd/testdata/scripts/edgecases.txt similarity index 100% rename from testdata/scripts/edgecases.txt rename to internal/cmd/testdata/scripts/edgecases.txt diff --git a/testdata/scripts/edit.txt b/internal/cmd/testdata/scripts/edit.txt similarity index 100% rename from testdata/scripts/edit.txt rename to internal/cmd/testdata/scripts/edit.txt diff --git a/testdata/scripts/editconfig.txt b/internal/cmd/testdata/scripts/editconfig.txt similarity index 100% rename from testdata/scripts/editconfig.txt rename to internal/cmd/testdata/scripts/editconfig.txt diff --git a/testdata/scripts/errors.txt b/internal/cmd/testdata/scripts/errors.txt similarity index 100% rename from testdata/scripts/errors.txt rename to internal/cmd/testdata/scripts/errors.txt diff --git a/testdata/scripts/exclude.txt b/internal/cmd/testdata/scripts/exclude.txt similarity index 100% rename from testdata/scripts/exclude.txt rename to internal/cmd/testdata/scripts/exclude.txt diff --git a/testdata/scripts/executetemplate.txt b/internal/cmd/testdata/scripts/executetemplate.txt similarity index 100% rename from testdata/scripts/executetemplate.txt rename to internal/cmd/testdata/scripts/executetemplate.txt diff --git a/testdata/scripts/forget.txt b/internal/cmd/testdata/scripts/forget.txt similarity index 100% rename from testdata/scripts/forget.txt rename to internal/cmd/testdata/scripts/forget.txt diff --git a/testdata/scripts/git.txt b/internal/cmd/testdata/scripts/git.txt similarity index 100% rename from testdata/scripts/git.txt rename to internal/cmd/testdata/scripts/git.txt diff --git a/testdata/scripts/gopass.txt b/internal/cmd/testdata/scripts/gopass.txt similarity index 100% rename from testdata/scripts/gopass.txt rename to internal/cmd/testdata/scripts/gopass.txt diff --git a/testdata/scripts/gpg.txt b/internal/cmd/testdata/scripts/gpg.txt similarity index 100% rename from testdata/scripts/gpg.txt rename to internal/cmd/testdata/scripts/gpg.txt diff --git a/testdata/scripts/gpgencryption.txt b/internal/cmd/testdata/scripts/gpgencryption.txt similarity index 100% rename from testdata/scripts/gpgencryption.txt rename to internal/cmd/testdata/scripts/gpgencryption.txt diff --git a/testdata/scripts/gpgencryption_symmetric.txt b/internal/cmd/testdata/scripts/gpgencryption_symmetric.txt similarity index 100% rename from testdata/scripts/gpgencryption_symmetric.txt rename to internal/cmd/testdata/scripts/gpgencryption_symmetric.txt diff --git a/testdata/scripts/help.txt b/internal/cmd/testdata/scripts/help.txt similarity index 100% rename from testdata/scripts/help.txt rename to internal/cmd/testdata/scripts/help.txt diff --git a/testdata/scripts/ignore.txt b/internal/cmd/testdata/scripts/ignore.txt similarity index 100% rename from testdata/scripts/ignore.txt rename to internal/cmd/testdata/scripts/ignore.txt diff --git a/testdata/scripts/import.txt b/internal/cmd/testdata/scripts/import.txt similarity index 100% rename from testdata/scripts/import.txt rename to internal/cmd/testdata/scripts/import.txt diff --git a/testdata/scripts/init.txt b/internal/cmd/testdata/scripts/init.txt similarity index 100% rename from testdata/scripts/init.txt rename to internal/cmd/testdata/scripts/init.txt diff --git a/testdata/scripts/issue-1161.txt b/internal/cmd/testdata/scripts/issue-1161.txt similarity index 100% rename from testdata/scripts/issue-1161.txt rename to internal/cmd/testdata/scripts/issue-1161.txt diff --git a/testdata/scripts/issue-1213.txt b/internal/cmd/testdata/scripts/issue-1213.txt similarity index 100% rename from testdata/scripts/issue-1213.txt rename to internal/cmd/testdata/scripts/issue-1213.txt diff --git a/testdata/scripts/issue-796.txt b/internal/cmd/testdata/scripts/issue-796.txt similarity index 100% rename from testdata/scripts/issue-796.txt rename to internal/cmd/testdata/scripts/issue-796.txt diff --git a/testdata/scripts/keep-going.txt b/internal/cmd/testdata/scripts/keep-going.txt similarity index 100% rename from testdata/scripts/keep-going.txt rename to internal/cmd/testdata/scripts/keep-going.txt diff --git a/testdata/scripts/keepassxc.txt b/internal/cmd/testdata/scripts/keepassxc.txt similarity index 100% rename from testdata/scripts/keepassxc.txt rename to internal/cmd/testdata/scripts/keepassxc.txt diff --git a/testdata/scripts/lastpass.txt b/internal/cmd/testdata/scripts/lastpass.txt similarity index 100% rename from testdata/scripts/lastpass.txt rename to internal/cmd/testdata/scripts/lastpass.txt diff --git a/testdata/scripts/managed.txt b/internal/cmd/testdata/scripts/managed.txt similarity index 100% rename from testdata/scripts/managed.txt rename to internal/cmd/testdata/scripts/managed.txt diff --git a/testdata/scripts/merge.txt b/internal/cmd/testdata/scripts/merge.txt similarity index 84% rename from testdata/scripts/merge.txt rename to internal/cmd/testdata/scripts/merge.txt index a2e6ae97103..4043a2d06f4 100644 --- a/testdata/scripts/merge.txt +++ b/internal/cmd/testdata/scripts/merge.txt @@ -10,7 +10,7 @@ stdout ^${HOME@R}/\.file\s+${CHEZMOISOURCEDIR@R}/dot_file\s+${WORK@R}/.*/\.file$ # test that chezmoi merge falls back to a two-way merge when the template is invalid # FIXME the following test fails # chezmoi merge $HOME${/}.invalid_template -# stdout ^${HOME@R}/\.invalid_template\s+${CHEZMOISOURCEDIR}/dot_invalid_template\.tmpl$ +# stdout ^${HOME@R}/\.invalid_template\s+$CHEZMOISOURCEDIR/dot_invalid_template\.tmpl$ -- bin/vimdiff -- #!/bin/sh diff --git a/testdata/scripts/modify.txt b/internal/cmd/testdata/scripts/modify.txt similarity index 100% rename from testdata/scripts/modify.txt rename to internal/cmd/testdata/scripts/modify.txt diff --git a/testdata/scripts/noencryption.txt b/internal/cmd/testdata/scripts/noencryption.txt similarity index 100% rename from testdata/scripts/noencryption.txt rename to internal/cmd/testdata/scripts/noencryption.txt diff --git a/testdata/scripts/onepassword.txt b/internal/cmd/testdata/scripts/onepassword.txt similarity index 100% rename from testdata/scripts/onepassword.txt rename to internal/cmd/testdata/scripts/onepassword.txt diff --git a/testdata/scripts/options.txt b/internal/cmd/testdata/scripts/options.txt similarity index 100% rename from testdata/scripts/options.txt rename to internal/cmd/testdata/scripts/options.txt diff --git a/testdata/scripts/pass.txt b/internal/cmd/testdata/scripts/pass.txt similarity index 100% rename from testdata/scripts/pass.txt rename to internal/cmd/testdata/scripts/pass.txt diff --git a/testdata/scripts/purge.txt b/internal/cmd/testdata/scripts/purge.txt similarity index 100% rename from testdata/scripts/purge.txt rename to internal/cmd/testdata/scripts/purge.txt diff --git a/testdata/scripts/re-add.txt b/internal/cmd/testdata/scripts/re-add.txt similarity index 78% rename from testdata/scripts/re-add.txt rename to internal/cmd/testdata/scripts/re-add.txt index 290bbcdb6b4..cff7d127a3b 100644 --- a/testdata/scripts/re-add.txt +++ b/internal/cmd/testdata/scripts/re-add.txt @@ -3,9 +3,9 @@ mksourcedir # test that chezmoi re-add adds all modified files chezmoi apply --force -edit $HOME${/}.file -edit $HOME${/}.dir/file -edit $HOME${/}.dir/subdir/file +edit $HOME/.file +edit $HOME/.dir/file +edit $HOME/.dir/subdir/file chezmoi re-add grep '# edited' $CHEZMOISOURCEDIR/dot_file grep '# edited' $CHEZMOISOURCEDIR/dot_dir/file diff --git a/testdata/scripts/remove.txt b/internal/cmd/testdata/scripts/remove.txt similarity index 100% rename from testdata/scripts/remove.txt rename to internal/cmd/testdata/scripts/remove.txt diff --git a/testdata/scripts/runscriptdir_unix.txt b/internal/cmd/testdata/scripts/runscriptdir_unix.txt similarity index 100% rename from testdata/scripts/runscriptdir_unix.txt rename to internal/cmd/testdata/scripts/runscriptdir_unix.txt diff --git a/testdata/scripts/script_unix.txt b/internal/cmd/testdata/scripts/script_unix.txt similarity index 100% rename from testdata/scripts/script_unix.txt rename to internal/cmd/testdata/scripts/script_unix.txt diff --git a/testdata/scripts/script_windows.txt b/internal/cmd/testdata/scripts/script_windows.txt similarity index 100% rename from testdata/scripts/script_windows.txt rename to internal/cmd/testdata/scripts/script_windows.txt diff --git a/testdata/scripts/scriptonce_unix.txt b/internal/cmd/testdata/scripts/scriptonce_unix.txt similarity index 100% rename from testdata/scripts/scriptonce_unix.txt rename to internal/cmd/testdata/scripts/scriptonce_unix.txt diff --git a/testdata/scripts/scriptonce_windows.txt b/internal/cmd/testdata/scripts/scriptonce_windows.txt similarity index 100% rename from testdata/scripts/scriptonce_windows.txt rename to internal/cmd/testdata/scripts/scriptonce_windows.txt diff --git a/testdata/scripts/scriptorder_unix.txt b/internal/cmd/testdata/scripts/scriptorder_unix.txt similarity index 100% rename from testdata/scripts/scriptorder_unix.txt rename to internal/cmd/testdata/scripts/scriptorder_unix.txt diff --git a/testdata/scripts/scriptorder_windows.txt b/internal/cmd/testdata/scripts/scriptorder_windows.txt similarity index 100% rename from testdata/scripts/scriptorder_windows.txt rename to internal/cmd/testdata/scripts/scriptorder_windows.txt diff --git a/testdata/scripts/scriptsubdir_unix.txt b/internal/cmd/testdata/scripts/scriptsubdir_unix.txt similarity index 100% rename from testdata/scripts/scriptsubdir_unix.txt rename to internal/cmd/testdata/scripts/scriptsubdir_unix.txt diff --git a/testdata/scripts/scriptsubdir_windows.txt b/internal/cmd/testdata/scripts/scriptsubdir_windows.txt similarity index 100% rename from testdata/scripts/scriptsubdir_windows.txt rename to internal/cmd/testdata/scripts/scriptsubdir_windows.txt diff --git a/testdata/scripts/secret.txt b/internal/cmd/testdata/scripts/secret.txt similarity index 100% rename from testdata/scripts/secret.txt rename to internal/cmd/testdata/scripts/secret.txt diff --git a/testdata/scripts/sourcedir.txt b/internal/cmd/testdata/scripts/sourcedir.txt similarity index 100% rename from testdata/scripts/sourcedir.txt rename to internal/cmd/testdata/scripts/sourcedir.txt diff --git a/testdata/scripts/sourcepath.txt b/internal/cmd/testdata/scripts/sourcepath.txt similarity index 100% rename from testdata/scripts/sourcepath.txt rename to internal/cmd/testdata/scripts/sourcepath.txt diff --git a/testdata/scripts/state.txt b/internal/cmd/testdata/scripts/state.txt similarity index 100% rename from testdata/scripts/state.txt rename to internal/cmd/testdata/scripts/state.txt diff --git a/testdata/scripts/state_unix.txt b/internal/cmd/testdata/scripts/state_unix.txt similarity index 100% rename from testdata/scripts/state_unix.txt rename to internal/cmd/testdata/scripts/state_unix.txt diff --git a/testdata/scripts/state_windows.txt b/internal/cmd/testdata/scripts/state_windows.txt similarity index 100% rename from testdata/scripts/state_windows.txt rename to internal/cmd/testdata/scripts/state_windows.txt diff --git a/testdata/scripts/status.txt b/internal/cmd/testdata/scripts/status.txt similarity index 100% rename from testdata/scripts/status.txt rename to internal/cmd/testdata/scripts/status.txt diff --git a/testdata/scripts/symlinks.txt b/internal/cmd/testdata/scripts/symlinks.txt similarity index 88% rename from testdata/scripts/symlinks.txt rename to internal/cmd/testdata/scripts/symlinks.txt index 93f6bfb98d1..38af47549ad 100644 --- a/testdata/scripts/symlinks.txt +++ b/internal/cmd/testdata/scripts/symlinks.txt @@ -8,19 +8,19 @@ chezmoi apply $HOME${/}.template cmp $HOME/.template $HOME/.file # test that chezmoi add --template-symlinks replaces absolute symlinks, pointing to files inside home, with templates -symlink ${HOME}${/}.symlink_absolute -> $HOME/.dir/subdir/file +symlink $HOME/.symlink_absolute -> $HOME/.dir/subdir/file chezmoi add --template-symlinks $HOME${/}.symlink_absolute cmp $CHEZMOISOURCEDIR/symlink_dot_symlink_absolute.tmpl golden/symlink_dot_symlink_absolute.tmpl # test that chezmoi add --template-symlinks replaces absolute symlinks, pointing to files inside the source directory, with templates -symlink $HOME${/}.symlink_source -> $CHEZMOISOURCEDIR/.dir/subdir/file +symlink $HOME/.symlink_source -> $CHEZMOISOURCEDIR/.dir/subdir/file chezmoi add --template-symlinks $HOME${/}.symlink_source cmp $CHEZMOISOURCEDIR/symlink_dot_symlink_source.tmpl golden/symlink_dot_symlink_source.tmpl chhome home2/user # test that chezmoi add reads add.templateSymlinks from the config file -symlink ${HOME}${/}.symlink_absolute -> $HOME/.dir/subdir/file +symlink $HOME/.symlink_absolute -> $HOME/.dir/subdir/file chezmoi add --template-symlinks $HOME${/}.symlink_absolute cmp $CHEZMOISOURCEDIR/symlink_dot_symlink_absolute.tmpl golden/symlink_dot_symlink_absolute.tmpl diff --git a/testdata/scripts/templatedata.txt b/internal/cmd/testdata/scripts/templatedata.txt similarity index 100% rename from testdata/scripts/templatedata.txt rename to internal/cmd/testdata/scripts/templatedata.txt diff --git a/testdata/scripts/templatefuncs.txt b/internal/cmd/testdata/scripts/templatefuncs.txt similarity index 99% rename from testdata/scripts/templatefuncs.txt rename to internal/cmd/testdata/scripts/templatefuncs.txt index 5f0d76fba31..c1d56bf9618 100644 --- a/testdata/scripts/templatefuncs.txt +++ b/internal/cmd/testdata/scripts/templatefuncs.txt @@ -27,7 +27,7 @@ stdout a${/}b # test lookPath template function chezmoi execute-template '{{ lookPath "go" }}' -stdout go${exe} +stdout go$exe # test stat template function chezmoi execute-template '{{ (stat ".").isDir }}' diff --git a/testdata/scripts/tilde.txt b/internal/cmd/testdata/scripts/tilde.txt similarity index 100% rename from testdata/scripts/tilde.txt rename to internal/cmd/testdata/scripts/tilde.txt diff --git a/testdata/scripts/umask.txt b/internal/cmd/testdata/scripts/umask.txt similarity index 100% rename from testdata/scripts/umask.txt rename to internal/cmd/testdata/scripts/umask.txt diff --git a/testdata/scripts/unmanaged.txt b/internal/cmd/testdata/scripts/unmanaged.txt similarity index 100% rename from testdata/scripts/unmanaged.txt rename to internal/cmd/testdata/scripts/unmanaged.txt diff --git a/testdata/scripts/update.txt b/internal/cmd/testdata/scripts/update.txt similarity index 100% rename from testdata/scripts/update.txt rename to internal/cmd/testdata/scripts/update.txt diff --git a/testdata/scripts/vault.txt b/internal/cmd/testdata/scripts/vault.txt similarity index 100% rename from testdata/scripts/vault.txt rename to internal/cmd/testdata/scripts/vault.txt diff --git a/testdata/scripts/verify.txt b/internal/cmd/testdata/scripts/verify.txt similarity index 100% rename from testdata/scripts/verify.txt rename to internal/cmd/testdata/scripts/verify.txt diff --git a/testdata/scripts/version.txt b/internal/cmd/testdata/scripts/version.txt similarity index 100% rename from testdata/scripts/version.txt rename to internal/cmd/testdata/scripts/version.txt diff --git a/cmd/unmanagedcmd.go b/internal/cmd/unmanagedcmd.go similarity index 100% rename from cmd/unmanagedcmd.go rename to internal/cmd/unmanagedcmd.go diff --git a/cmd/updatecmd.go b/internal/cmd/updatecmd.go similarity index 100% rename from cmd/updatecmd.go rename to internal/cmd/updatecmd.go diff --git a/cmd/upgradecmd.go b/internal/cmd/upgradecmd.go similarity index 100% rename from cmd/upgradecmd.go rename to internal/cmd/upgradecmd.go diff --git a/cmd/upgradecmd_unix.go b/internal/cmd/upgradecmd_unix.go similarity index 100% rename from cmd/upgradecmd_unix.go rename to internal/cmd/upgradecmd_unix.go diff --git a/cmd/util.go b/internal/cmd/util.go similarity index 100% rename from cmd/util.go rename to internal/cmd/util.go diff --git a/cmd/util_test.go b/internal/cmd/util_test.go similarity index 100% rename from cmd/util_test.go rename to internal/cmd/util_test.go diff --git a/cmd/util_unix.go b/internal/cmd/util_unix.go similarity index 100% rename from cmd/util_unix.go rename to internal/cmd/util_unix.go diff --git a/cmd/util_windows.go b/internal/cmd/util_windows.go similarity index 100% rename from cmd/util_windows.go rename to internal/cmd/util_windows.go diff --git a/cmd/vaulttemplatefuncs.go b/internal/cmd/vaulttemplatefuncs.go similarity index 100% rename from cmd/vaulttemplatefuncs.go rename to internal/cmd/vaulttemplatefuncs.go diff --git a/cmd/verifycmd.go b/internal/cmd/verifycmd.go similarity index 100% rename from cmd/verifycmd.go rename to internal/cmd/verifycmd.go diff --git a/cmd/verifycmd_test.go b/internal/cmd/verifycmd_test.go similarity index 100% rename from cmd/verifycmd_test.go rename to internal/cmd/verifycmd_test.go diff --git a/internal/cmd/generate-chezmoi.io-content-docs/main.go b/internal/cmds/generate-chezmoi.io-content-docs/main.go similarity index 100% rename from internal/cmd/generate-chezmoi.io-content-docs/main.go rename to internal/cmds/generate-chezmoi.io-content-docs/main.go diff --git a/internal/cmd/generate-install.sh/install.sh.tmpl b/internal/cmds/generate-install.sh/install.sh.tmpl similarity index 100% rename from internal/cmd/generate-install.sh/install.sh.tmpl rename to internal/cmds/generate-install.sh/install.sh.tmpl diff --git a/internal/cmd/generate-install.sh/main.go b/internal/cmds/generate-install.sh/main.go similarity index 96% rename from internal/cmd/generate-install.sh/main.go rename to internal/cmds/generate-install.sh/main.go index b4f3de6da33..473d10b2a4f 100644 --- a/internal/cmd/generate-install.sh/main.go +++ b/internal/cmds/generate-install.sh/main.go @@ -111,7 +111,7 @@ func run() error { }) // Generate install.sh. - installShTemplate, err := template.ParseFiles("internal/cmd/generate-install.sh/install.sh.tmpl") + installShTemplate, err := template.ParseFiles("internal/cmds/generate-install.sh/install.sh.tmpl") if err != nil { return err } diff --git a/internal/cmd/lint-whitespace/main.go b/internal/cmds/lint-whitespace/main.go similarity index 100% rename from internal/cmd/lint-whitespace/main.go rename to internal/cmds/lint-whitespace/main.go diff --git a/main.go b/main.go index 06ba92f134f..6c095334a86 100644 --- a/main.go +++ b/main.go @@ -3,7 +3,7 @@ package main import ( "os" - "github.com/twpayne/chezmoi/v2/cmd" + "github.com/twpayne/chezmoi/v2/internal/cmd" ) var (