Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2891222
exec_arc.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
844 B
Referenced Files
None
Subscribers
None
exec_arc.ts
View Options
import
*
as
execa
from
'execa'
;
export
type
ReturnValue
=
execa
.
ExecaReturnValue
<
string
>
;
type
Handler
=
((
x
:
execa.ExecaReturnValue
<
string
>
)
=>
void
);
export
type
ConduitHandler
=
(
x
:
ConduitResponse
)
=>
void
;
export
interface
ConduitResponse
{
error?
:
string
;
// TODO check
errorMessage?
:
string
;
// TODO check
response
:
any
;
}
export
function
arc
(
args
:
string
[],
handler
:
Handler
,
cwd?
:
string
)
{
execa
(
'arc'
,
args
,
{
cwd
:
cwd
}).
then
(
handler
,
handler
);
}
export
function
callConduit
(
method
:
string
,
body
:
object
,
handler
:
ConduitHandler
,
cwd?
:
string
)
{
function
hs
(
value
:
execa.ExecaReturnValue
<
string
>
)
{
const
output
=
JSON
.
parse
(
value
.
stdout
);
handler
(
output
);
}
execa
(
'arc'
,
[
'call-conduit'
,
'--'
,
method
],
{
input
:
JSON.stringify
(
body
),
cwd
:
cwd
,
}).
then
(
hs
,
hs
);
}
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Sun, Jan 19, 14:51 (3 w, 2 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1125678
Default Alt Text
exec_arc.ts (844 B)
Attached To
Mode
R7 arc-vscode
Attached
Detach File
Event Timeline
Log In to Comment