fix: validatePath now returns an error when the workspace is empty.
This commit is contained in:
parent
b8b3f117f1
commit
74a0ff84a9
1 changed files with 1 additions and 1 deletions
|
|
@ -13,7 +13,7 @@ import (
|
||||||
// validatePath ensures the given path is within the workspace if restrict is true.
|
// validatePath ensures the given path is within the workspace if restrict is true.
|
||||||
func validatePath(path, workspace string, restrict bool) (string, error) {
|
func validatePath(path, workspace string, restrict bool) (string, error) {
|
||||||
if workspace == "" {
|
if workspace == "" {
|
||||||
return path, nil
|
return path, fmt.Errorf("workspace is not defined")
|
||||||
}
|
}
|
||||||
|
|
||||||
absWorkspace, err := filepath.Abs(workspace)
|
absWorkspace, err := filepath.Abs(workspace)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue