mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-10-19 20:06:07 +08:00
feat: handle exist env file for app install (#8491)
This commit is contained in:
parent
147db1ac0d
commit
d025fc6abd
1 changed files with 6 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue