Skip to content

Commit 50a1b89

Browse files
committed
WIP
Signed-off-by: Joseph Kato <joseph@jdkato.io>
1 parent 395ef8a commit 50a1b89

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

cmd/vale/sync.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -141,15 +141,15 @@ func installPkg(dir, name, styles string, index int) error {
141141
return nil
142142
}
143143

144-
func moveDir(old, new string) error { //nolint:predeclared
145-
files, err := os.ReadDir(old)
144+
func moveDir(oldPath, newPath string) error {
145+
files, err := os.ReadDir(oldPath)
146146
if err != nil {
147147
return err
148148
}
149149

150150
for _, file := range files {
151151
if !file.IsDir() || file.Name() != "config" {
152-
if err = moveAsset(file.Name(), old, new); err != nil {
152+
if err = moveAsset(file.Name(), oldPath, newPath); err != nil {
153153
return err
154154
}
155155
}
@@ -158,17 +158,17 @@ func moveDir(old, new string) error { //nolint:predeclared
158158
return nil
159159
}
160160

161-
func moveAsset(name, old, new string) error { //nolint:predeclared
162-
src := filepath.Join(old, name)
163-
dst := filepath.Join(new, name)
161+
func moveAsset(name, oldPath, newPath string) error {
162+
src := filepath.Join(oldPath, name)
163+
dst := filepath.Join(newPath, name)
164164

165165
if system.FileExists(dst) || system.IsDir(dst) {
166166
if err := os.RemoveAll(dst); err != nil {
167167
return err
168168
}
169169
}
170170

171-
err := os.MkdirAll(new, os.ModePerm)
171+
err := os.MkdirAll(newPath, os.ModePerm)
172172
if err != nil {
173173
return err
174174
}

0 commit comments

Comments
 (0)