Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
5c49808f
Commit
5c49808f
authored
Dec 01, 2020
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change emitting event
parent
40484a34
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
11 deletions
+12
-11
terminal.js
apps/remix-ide/src/app/panels/terminal.js
+5
-5
gitClient.ts
libs/remixd/src/services/gitClient.ts
+7
-6
No files found.
apps/remix-ide/src/app/panels/terminal.js
View file @
5c49808f
...
...
@@ -104,11 +104,11 @@ class Terminal extends Plugin {
this
.
on
(
'scriptRunner'
,
'error'
,
(
msg
)
=>
{
this
.
commands
.
error
.
apply
(
this
.
commands
,
msg
.
data
)
})
this
.
on
(
'git'
,
'log'
,
(
result
)
=>
{
this
.
commands
.
html
.
apply
(
this
.
commands
,
yo
`<pre>
${
result
}
</pre>`
)
this
.
on
(
'git'
,
'log'
,
(
result
)
=>
{
this
.
commands
.
html
(
yo
`<pre>
${
result
}
</pre>`
)
})
this
.
on
(
'git'
,
'error'
,
(
result
)
=>
{
this
.
commands
.
html
.
apply
(
this
.
commands
,
yo
`<pre>
${
result
}
</pre>`
)
this
.
commands
.
html
(
yo
`<pre>
${
result
}
</pre>`
)
})
}
...
...
@@ -493,7 +493,7 @@ class Terminal extends Plugin {
return
self
.
_view
.
el
function
wrapScript
(
script
)
{
const
isKnownScript
=
[
'remix.'
,
'git'
].
some
(
prefix
=>
script
.
trim
().
startWith
(
prefix
))
const
isKnownScript
=
[
'remix.'
,
'git'
].
some
(
prefix
=>
script
.
trim
().
start
s
With
(
prefix
))
if
(
isKnownScript
)
return
script
return
`
try {
...
...
@@ -755,7 +755,7 @@ class Terminal extends Plugin {
}
}
try
{
if
(
script
.
trim
().
startWith
(
'git'
))
{
if
(
script
.
trim
().
start
s
With
(
'git'
))
{
await
this
.
call
(
'git'
,
'execute'
,
script
)
}
else
{
await
this
.
call
(
'scriptRunner'
,
'execute'
,
script
)
...
...
libs/remixd/src/services/gitClient.ts
View file @
5c49808f
...
...
@@ -21,16 +21,17 @@ export class GitClient extends PluginClient {
assertCommand
(
cmd
)
const
options
=
{
cwd
:
this
.
currentSharedFolder
,
shell
:
true
}
const
child
=
spawn
(
cmd
,
options
)
let
result
=
''
let
error
=
''
child
.
stdout
.
on
(
'data'
,
(
data
)
=>
{
this
.
emit
(
'log'
,
data
.
toString
()
)
result
+=
data
.
toString
(
)
})
child
.
stderr
.
on
(
'data'
,
(
err
)
=>
{
this
.
emit
(
'error'
,
err
.
toString
()
)
error
+=
err
.
toString
(
)
})
child
.
on
(
'close'
,
(
exitCode
)
=>
{
if
(
exitCode
!==
0
)
{
this
.
emit
(
'error'
,
'exit with '
+
exitCode
)
}
child
.
on
(
'close'
,
()
=>
{
if
(
error
!==
''
)
this
.
emit
(
'error'
,
error
)
else
this
.
emit
(
'log'
,
result
)
})
}
}
...
...
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