Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F1263205
exec_async.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
547 B
Referenced Files
None
Subscribers
None
exec_async.ts
View Options
/* eslint-disable @typescript-eslint/restrict-template-expressions */
import
{
exec
}
from
"child_process"
;
export
const
execAsync
=
(
cmd
:
string
)
=>
{
return
new
Promise
<
void
>
((
resolve
,
reject
)
=>
{
const
process
=
exec
(
cmd
);
console
.
log
(
"EXECUTING"
,
cmd
);
process
?
.
stdout
?
.
on
(
"data"
,
(
data
)
=>
{
console
.
log
(
`stdout:
${
data
}
`
);
});
process
?
.
stderr
?
.
on
(
"data"
,
(
data
)
=>
{
console
.
log
(
`stdout:
${
data
}
`
);
});
process
.
on
(
"exit"
,
(
code
)
=>
{
if
(
code
==
0
)
{
resolve
();
}
else
{
reject
();
}
});
});
};
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Fri, Jan 24, 16:50 (1 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
601467
Default Alt Text
exec_async.ts (547 B)
Attached To
Mode
rSGEN sealgen
Attached
Detach File
Event Timeline
Log In to Comment