We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f4bd75a commit 7cb02c8Copy full SHA for 7cb02c8
utils/perms/chmod.go
@@ -4,13 +4,17 @@
4
package perms
5
6
import (
7
+ "errors"
8
"os"
9
"path/filepath"
10
)
11
12
// ChmodR sets the permissions of all directories and optionally files to [perm]
13
// permissions.
14
func ChmodR(dir string, dirOnly bool, perm os.FileMode) error {
15
+ if _, err := os.Stat(dir); errors.Is(err, os.ErrNotExist) {
16
+ return nil
17
+ }
18
return filepath.Walk(dir, func(name string, info os.FileInfo, err error) error {
19
if err != nil || (dirOnly && !info.IsDir()) {
20
return err
0 commit comments