修复环境变量中单引号转义

This commit is contained in:
whyour
2023-09-01 15:15:25 +08:00
parent 461fa8e131
commit fe934fa4af
4 changed files with 8 additions and 35 deletions
+1 -3
View File
@@ -202,9 +202,7 @@ export default class EnvService {
let value = group
.map((x) => x.value)
.join('&')
.replace(/(\\)[^n]/g, '\\\\')
.replace(/(\\$)/, '\\\\')
.replace(/'/g, "\\'")
.replace(/'/g, "'\\''")
.trim();
env_string += `export ${key}='${value}'\n`;
}