x
This commit is contained in:
+3
-12
@@ -217,7 +217,7 @@ func AddNodePlugin(path, name string) error {
|
|||||||
f.Suffix = ".js"
|
f.Suffix = ".js"
|
||||||
f.Type = "node"
|
f.Type = "node"
|
||||||
f.Path = path
|
f.Path = path
|
||||||
f.Handle = func(s common.Sender, _ func(vm *goja.Runtime)) interface{} {
|
f.Handle = func(s common.Sender, f func(vm *goja.Runtime)) interface{} {
|
||||||
console := &Console{UUID: uuid}
|
console := &Console{UUID: uuid}
|
||||||
s.SetPluginID(uuid)
|
s.SetPluginID(uuid)
|
||||||
plt := s.GetImType()
|
plt := s.GetImType()
|
||||||
@@ -253,6 +253,7 @@ func AddNodePlugin(path, name string) error {
|
|||||||
for scanner.Scan() {
|
for scanner.Scan() {
|
||||||
data := scanner.Text()
|
data := scanner.Text()
|
||||||
fmt.Println(data)
|
fmt.Println(data)
|
||||||
|
|
||||||
// if _, err := file.WriteString(data + "\n"); err != nil {
|
// if _, err := file.WriteString(data + "\n"); err != nil {
|
||||||
// fmt.Printf("写入文件失败:%v\n", err)
|
// fmt.Printf("写入文件失败:%v\n", err)
|
||||||
// }
|
// }
|
||||||
@@ -262,24 +263,14 @@ func AddNodePlugin(path, name string) error {
|
|||||||
go func() {
|
go func() {
|
||||||
defer wg.Done()
|
defer wg.Done()
|
||||||
scanner := bufio.NewScanner(stderr)
|
scanner := bufio.NewScanner(stderr)
|
||||||
if f.OnStart {
|
|
||||||
for scanner.Scan() {
|
for scanner.Scan() {
|
||||||
data := scanner.Text()
|
data := scanner.Text()
|
||||||
// lines = append(lines, data)
|
|
||||||
fmt.Println(data)
|
fmt.Println(data)
|
||||||
|
console.Error(data)
|
||||||
// if _, err := file.WriteString(data + "\n"); err != nil {
|
// if _, err := file.WriteString(data + "\n"); err != nil {
|
||||||
// fmt.Printf("写入文件失败:%v\n", err)
|
// fmt.Printf("写入文件失败:%v\n", err)
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
// lines := []string{}
|
|
||||||
for scanner.Scan() {
|
|
||||||
data := scanner.Text()
|
|
||||||
fmt.Println(data)
|
|
||||||
// lines = append(lines, data)
|
|
||||||
}
|
|
||||||
// console.Error(strings.Join(lines, "\n"))
|
|
||||||
}
|
|
||||||
}()
|
}()
|
||||||
processes.Store(cmd, s)
|
processes.Store(cmd, s)
|
||||||
register := createSenderRegister(RUNTIME_ID)
|
register := createSenderRegister(RUNTIME_ID)
|
||||||
|
|||||||
Reference in New Issue
Block a user