fix(config): correct copy dir

main
Tran Hau 2021-01-18 16:50:36 +07:00
parent 04125f8cf5
commit 0689546a4d
1 changed files with 6 additions and 6 deletions

View File

@ -65,13 +65,13 @@ func (c *Config) Install() error {
for _, app := range c.Apps { for _, app := range c.Apps {
for _, file := range app.Files { for _, file := range app.Files {
if err := removeAndCopy(file.Internal, file.External, copy.CopyFile); err != nil { if err := removeAndCopy(file.Internal, file.External, copy.CopyFile); err != nil {
return fmt.Errorf("failed to remove and copy from %s to %s: %w", file.Internal, file.External) return fmt.Errorf("failed to remove and copy from %s to %s: %w", file.Internal, file.External, err)
} }
} }
for _, dir := range app.Dirs { for _, dir := range app.Dirs {
if err := removeAndCopy(dir.Internal, dir.External, copy.CopyFile); err != nil { if err := removeAndCopy(dir.Internal, dir.External, copy.CopyDir); err != nil {
return fmt.Errorf("failed to remove and copy from %s to %s: %w", dir.Internal, dir.External) return fmt.Errorf("failed to remove and copy from %s to %s: %w", dir.Internal, dir.External, err)
} }
} }
} }
@ -84,13 +84,13 @@ func (c *Config) Update() error {
for _, app := range c.Apps { for _, app := range c.Apps {
for _, file := range app.Files { for _, file := range app.Files {
if err := removeAndCopy(file.External, file.Internal, copy.CopyFile); err != nil { if err := removeAndCopy(file.External, file.Internal, copy.CopyFile); err != nil {
return fmt.Errorf("failed to remove and copy from %s to %s: %w", file.External, file.Internal) return fmt.Errorf("failed to remove and copy from %s to %s: %w", file.External, file.Internal, err)
} }
} }
for _, dir := range app.Dirs { for _, dir := range app.Dirs {
if err := removeAndCopy(dir.External, dir.Internal, copy.CopyFile); err != nil { if err := removeAndCopy(dir.External, dir.Internal, copy.CopyDir); err != nil {
return fmt.Errorf("failed to remove and copy from %s to %s: %w", dir.External, dir.Internal) return fmt.Errorf("failed to remove and copy from %s to %s: %w", dir.External, dir.Internal, err)
} }
} }
} }