fix: do not change permissions on config directory symlinks
When running in docker, the 'config' directory can be a symlink, which causes issues during plugin installation. Refs #7308
This commit is contained in:
@@ -108,6 +108,17 @@ func IsAbsPath(path string) bool {
|
||||
return strings.HasPrefix(path, "/")
|
||||
}
|
||||
|
||||
// IsSymlink returns true if the path is a symlink
|
||||
// if lstat fails, it returns false
|
||||
func IsSymlink(path string) bool {
|
||||
info, err := os.Lstat(path)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
return info.Mode()&os.ModeSymlink == os.ModeSymlink
|
||||
}
|
||||
|
||||
// ListFilesWithPrefix lists files within a given path that have a given prefix
|
||||
func ListFilesWithPrefix(path string, prefix string) []string {
|
||||
names, err := os.ReadDir(path)
|
||||
|
||||
Reference in New Issue
Block a user