Skip to content

Commit

Permalink
Use getEntries in chattr command
Browse files Browse the repository at this point in the history
  • Loading branch information
twpayne committed Dec 4, 2018
1 parent 615c3bd commit 4e74b17
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions cmd/chattr.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,12 @@ func (c *Config) runChattrCommand(fs vfs.FS, cmd *cobra.Command, args []string)
if err != nil {
return err
}
entries, err := c.getEntries(targetState, args[1:])
if err != nil {
return err
}
renames := make(map[string]string)
for _, arg := range args[1:] {
targetPath, err := filepath.Abs(arg)
if err != nil {
return err
}
entry, err := targetState.Get(targetPath)
if err != nil {
return err
}
if entry == nil {
return fmt.Errorf("%s: not under management", arg)
}
for _, entry := range entries {
oldSourceName := entry.SourceName()
var newSourceName string
switch entry := entry.(type) {
Expand Down

0 comments on commit 4e74b17

Please sign in to comment.