Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
mycard
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
9
Issues
9
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
mycard
Commits
897b2c84
Commit
897b2c84
authored
Aug 04, 2022
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix single quote in user dir name
parent
2165d969
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
app/apps.service.ts
app/apps.service.ts
+8
-5
No files found.
app/apps.service.ts
View file @
897b2c84
...
...
@@ -1008,18 +1008,21 @@ export class AppsService {
extract
(
file
:
string
,
dir
:
string
):
Observable
<
string
>
{
return
Observable
.
create
((
observer
:
Observer
<
string
>
)
=>
{
let
tarPath
=
this
.
tarPath
;
const
tarArgs
=
[
'
-xvf
'
,
file
,
'
-C
'
,
dir
];
if
(
process
.
platform
===
'
darwin
'
)
{
tarArgs
.
unshift
(
`--use-compress-program=
${
this
.
systemBinPath
(
'
zstd
'
)}
`
)
}
let
windowsArgumentsQuoted
:
boolean
=
false
;
if
((
file
.
includes
(
'
\'
'
)
||
dir
.
includes
(
'
\'
'
))
&&
process
.
platform
===
'
win32
'
)
{
if
((
file
.
includes
(
'
\'
'
)
||
dir
.
includes
(
'
\'
'
)
||
tarPath
.
includes
(
'
\'
'
)
)
&&
process
.
platform
===
'
win32
'
)
{
windowsArgumentsQuoted
=
true
;
tarArgs
[
1
]
=
`"
${
file
}
"`
;
tarArgs
[
3
]
=
`"
${
dir
}
"`
;
tarPath
=
`"
${
tarPath
}
"`
;
}
Logger
.
info
(
'
Start to extract... Command Line:
'
+
this
.
tarPath
,
tarArgs
.
join
(
'
'
));
let
tarProcess
=
child_process
.
spawn
(
this
.
tarPath
,
tarArgs
,
{
windowsVerbatimArguments
:
windowsArgumentsQuoted
});
Logger
.
info
(
'
Start to extract...
'
);
Logger
.
info
(
'
Command Line:
'
+
tarPath
,
tarArgs
.
join
(
'
'
));
let
tarProcess
=
child_process
.
spawn
(
tarPath
,
tarArgs
,
{
shell
:
windowsArgumentsQuoted
});
let
rl
=
readline
.
createInterface
({
input
:
this
.
getTarStream
(
tarProcess
),
});
...
...
@@ -1029,7 +1032,7 @@ export class AppsService {
});
tarProcess
.
on
(
'
error
'
,
(
e
)
=>
{
console
.
log
(
e
);
console
.
log
(
tarProcess
.
spawnargs
);
Logger
.
info
(
'
spawnargs
'
,
tarProcess
.
spawnargs
);
new
Notification
(
'
MyCard
'
,
{
body
:
'
解压失败
'
+
e
.
message
});
observer
.
error
(
e
);
});
...
...
@@ -1039,7 +1042,7 @@ export class AppsService {
}
else
{
let
e
=
new
Error
(
'
tarProcess错误码:
'
+
code
);
console
.
log
(
e
);
console
.
log
(
tarProcess
.
spawnargs
);
Logger
.
info
(
'
spawnargs
'
,
tarProcess
.
spawnargs
);
new
Notification
(
'
MyCard
'
,
{
body
:
'
解压失败
'
+
e
.
message
});
observer
.
error
(
e
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment