mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-09-22 08:00:53 +00:00
feat: handle exist env file for app install (#8491)
This commit is contained in:
@@ -967,8 +967,13 @@ func copyData(task *task.Task, app model.App, appDetail model.AppDetail, appInst
|
||||
return
|
||||
}
|
||||
envPath := path.Join(appDir, ".env")
|
||||
|
||||
envParams := make(map[string]string, len(req.Params))
|
||||
if fileOp.Stat(envPath) {
|
||||
envs, _ := gotenv.Read(envPath)
|
||||
for k, v := range envs {
|
||||
envParams[k] = v
|
||||
}
|
||||
}
|
||||
handleMap(req.Params, envParams)
|
||||
if err = env.Write(envParams, envPath); err != nil {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user