mirror of https://github.com/portainer/portainer
fix(libstack): data loss for stack with relative path [FR-437] (#548)
parent
a61c1004d3
commit
4b218553c3
|
@ -68,7 +68,7 @@ func copyFile(src, dst string) error {
|
|||
defer from.Close()
|
||||
|
||||
// has to include 'execute' bit, otherwise fails. MkdirAll follows `mkdir -m` restrictions
|
||||
if err := os.MkdirAll(filepath.Dir(dst), 0744); err != nil {
|
||||
if err := os.MkdirAll(filepath.Dir(dst), 0755); err != nil {
|
||||
return err
|
||||
}
|
||||
to, err := os.Create(dst)
|
||||
|
|
|
@ -98,6 +98,11 @@ func withComposeService(
|
|||
WorkingDir: filepath.Dir(filePaths[0]),
|
||||
}
|
||||
|
||||
if options.ProjectDir != "" {
|
||||
// When relative paths are used in the compose file, the project directory is used as the base path
|
||||
configDetails.WorkingDir = options.ProjectDir
|
||||
}
|
||||
|
||||
for _, p := range filePaths {
|
||||
configDetails.ConfigFiles = append(configDetails.ConfigFiles, types.ConfigFile{Filename: p})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue