Skip to content

Commit

Permalink
fix: Fix chezmoi target-path when using .chezmoiroot
Browse files Browse the repository at this point in the history
  • Loading branch information
twpayne committed Feb 11, 2023
1 parent f4b6df4 commit 31c2d19
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/cmd/targetpathcmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (c *Config) runTargetPathCmd(cmd *cobra.Command, args []string) error {
return err
}

argRelPath, err := argAbsPath.TrimDirPrefix(c.SourceDirAbsPath)
argRelPath, err := argAbsPath.TrimDirPrefix(c.sourceDirAbsPath)
if err != nil {
return err
}
Expand Down
10 changes: 10 additions & 0 deletions pkg/cmd/testdata/scripts/issue2752.txtar
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[windows] skip 'uses forward slashes in paths'

# test that chezmoi target-path does not include .chezmoiroot in the output
exec chezmoi target-path $CHEZMOISOURCEDIR${/}home${/}dot_file
stdout ${HOME@R}/\.file

-- home/user/.local/share/chezmoi/.chezmoiroot --
home
-- home/user/.local/share/chezmoi/home/dot_file --
# contents of .file

0 comments on commit 31c2d19

Please sign in to comment.