Skip to content

Commit

Permalink
fix: 测试
Browse files Browse the repository at this point in the history
  • Loading branch information
devhaozi committed Sep 14, 2024
1 parent 8a51ee8 commit 04082e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/io/path.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ func Mkdir(path string, permission os.FileMode) error {

// Chmod 修改文件/目录权限
func Chmod(path string, permission os.FileMode) error {
cmd := exec.Command("chmod", "-R", fmt.Sprintf("%o", permission), path)
cmd := exec.Command("sudo", "chmod", "-R", fmt.Sprintf("%o", permission), path)
return cmd.Run()
}

// Chown 修改文件或目录所有者
func Chown(path, user, group string) error {
cmd := exec.Command("chown", "-R", user+":"+group, path)
cmd := exec.Command("sudo", "chown", "-R", user+":"+group, path)
return cmd.Run()
}

Expand Down

0 comments on commit 04082e0

Please sign in to comment.