Commit cd476f09 authored by antoor's avatar antoor

Add load-cache features

增加加载缓存功能
parent 4c492378
......@@ -136,17 +136,16 @@ class Terminal {
if (cmd === 'exit' || cmd === 'quit') { return this.cell.close() };
term.pause();
// 是否有缓存
if ((this.opts.otherConf || {})['terminal-cache'] === 1) {
let cacheTag = 'command-' + new Buffer(this.path + cmd).toString('base64');
let cacheCmd;
if (cacheCmd = this.cache.get(cacheTag)) {
term.echo(
antSword.noxss(cacheCmd, false)
);
return term.resume();
};
}
let cacheTag = 'command-' + new Buffer(this.path + cmd).toString('base64');
let cacheCmd = this.cache.get(cacheTag);
if (
(this.opts.otherConf || {})['terminal-cache'] === 1 && cacheCmd
) {
term.echo(
antSword.noxss(cacheCmd, false)
);
return term.resume();
};
// 开始执行命令
this.core.request(
this.core.command.exec({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment