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

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

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`;
}

View File

@ -390,9 +390,10 @@ select:-webkit-autofill:focus {
}
pre {
word-break: break-all !important;
white-space: break-spaces !important;
padding: 0 !important;
word-break: break-all;
white-space: break-spaces;
padding: 0;
height: 100%;
}
.virtuallist {

View File

@ -241,7 +241,6 @@ const EditModal = ({
/>
<pre
style={{
height: '100%',
padding: '0 15px',
}}
>

View File

@ -75,16 +75,7 @@ const CheckUpdate = ({ socketMessage, systemInfo }: any) => {
</div>
</>
),
content: (
<pre
style={{
fontSize: 12,
fontWeight: 400,
}}
>
{lastLog}
</pre>
),
content: <pre>{lastLog}</pre>,
okText: intl.get('下载更新'),
cancelText: intl.get('以后再说'),
onOk() {
@ -109,16 +100,7 @@ const CheckUpdate = ({ socketMessage, systemInfo }: any) => {
okButtonProps: { disabled: true },
title: intl.get('下载更新中...'),
centered: true,
content: (
<pre
style={{
fontSize: 12,
fontWeight: 400,
}}
>
{value}
</pre>
),
content: <pre>{value}</pre>,
});
};
@ -185,14 +167,7 @@ const CheckUpdate = ({ socketMessage, systemInfo }: any) => {
okButtonProps: { disabled: !updateFailed },
content: (
<>
<pre
style={{
fontSize: 12,
fontWeight: 400,
}}
>
{newMessage}
</pre>
<pre>{newMessage}</pre>
<div id="log-identifier" style={{ paddingBottom: 5 }}></div>
</>
),