Skip to content

Commit f4d4991

Browse files
authored
Merge pull request #83 from twpayne/import-flags
Import cleanups
2 parents a91ea79 + 7f3b2a8 commit f4d4991

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

cmd/import.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
vfs "github.com/twpayne/go-vfs"
2020
)
2121

22-
var _importommand = &cobra.Command{
22+
var _importCommand = &cobra.Command{
2323
Use: "import",
2424
Args: cobra.MaximumNArgs(1),
2525
Short: "Import an archive",
@@ -33,9 +33,9 @@ type importCommandConfig struct {
3333
}
3434

3535
func init() {
36-
rootCommand.AddCommand(_importommand)
36+
rootCommand.AddCommand(_importCommand)
3737

38-
persistentFlags := _importommand.PersistentFlags()
38+
persistentFlags := _importCommand.PersistentFlags()
3939
persistentFlags.StringVarP(&config._import.destination, "destination", "d", "", "destination prefix")
4040
persistentFlags.IntVar(&config._import.stripComponents, "strip-components", 0, "strip components")
4141
persistentFlags.BoolVarP(&config._import.removeDestination, "remove-destination", "r", false, "remove destination before import")
@@ -83,5 +83,5 @@ func (c *Config) runImportCommand(fs vfs.FS, cmd *cobra.Command, args []string)
8383
return err
8484
}
8585
}
86-
return ts.Import(tar.NewReader(r), c._import.destination, c._import.stripComponents, mutator)
86+
return ts.ImportTAR(tar.NewReader(r), c._import.destination, c._import.stripComponents, mutator)
8787
}

lib/chezmoi/target_state.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ func (ts *TargetState) Get(target string) (Entry, error) {
193193
return ts.findEntry(targetName)
194194
}
195195

196-
// Import imports an archive.
197-
func (ts *TargetState) Import(r *tar.Reader, destinationDir string, stripComponents int, mutator Mutator) error {
196+
// ImportTAR imports a tar archive.
197+
func (ts *TargetState) ImportTAR(r *tar.Reader, destinationDir string, stripComponents int, mutator Mutator) error {
198198
for {
199199
header, err := r.Next()
200200
if err == io.EOF {

0 commit comments

Comments
 (0)