mirror of
https://github.com/nuintun/command-manager.git
synced 2025-10-21 02:41:23 +08:00
update files
This commit is contained in:
@@ -161,18 +161,21 @@ module.exports = Vue.component('app-main', {
|
||||
context.expandCommand = trigger && trigger.contains(target);
|
||||
}, false);
|
||||
|
||||
window.TERMSTR = '';
|
||||
|
||||
ipc.on('emulator', function (event, type, project, data){
|
||||
worker.postMessage({ action: 'write', name: project.name, data: data + '' });
|
||||
|
||||
window.TERMSTR += JSON.stringify(data.toString()) + '\n';
|
||||
switch (type) {
|
||||
case 'data':
|
||||
data = data.toString();
|
||||
break;
|
||||
case 'error':
|
||||
data = '\u001b[31m发生错误: \u001b[0m' + data.toString();
|
||||
break;
|
||||
case 'close':
|
||||
data = '\u001b[32m命令执行完成\u001b[0m';
|
||||
break;
|
||||
}
|
||||
worker.postMessage({ action: 'write', name: project.name, data: data.toString() });
|
||||
// event.sender.send('emulator', project, 'stop');
|
||||
});
|
||||
|
||||
window.doWrite = function (){
|
||||
require('fs').writeFile('./screen.text', window.TERMSTR);
|
||||
};
|
||||
},
|
||||
ready: function (){
|
||||
var context = this;
|
||||
@@ -183,8 +186,6 @@ module.exports = Vue.component('app-main', {
|
||||
}
|
||||
};
|
||||
|
||||
window.worker = worker;
|
||||
|
||||
openXTerm(this.project.name);
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user