mirror of
https://github.com/Eugeny/tabby.git
synced 2025-02-05 14:29:47 +08:00
lint
This commit is contained in:
parent
9eee600ccc
commit
0254cabdde
@ -40,16 +40,15 @@ export class SSHSession extends BaseSession {
|
||||
let found = false
|
||||
for (let script of this.scripts) {
|
||||
let match = false
|
||||
let cmd = ""
|
||||
let cmd = ''
|
||||
if (script.isRegex) {
|
||||
let re = new RegExp(script.expect, "g")
|
||||
let re = new RegExp(script.expect, 'g')
|
||||
if (dataString.match(re)) {
|
||||
cmd = dataString.replace(re, script.send)
|
||||
match = true
|
||||
found = true
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (dataString.includes(script.expect)) {
|
||||
cmd = script.send
|
||||
match = true
|
||||
@ -61,14 +60,12 @@ export class SSHSession extends BaseSession {
|
||||
console.log('Executing script: "' + cmd + '"')
|
||||
this.shell.write(cmd + '\n')
|
||||
this.scripts = this.scripts.filter(x => x !== script)
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (script.optional) {
|
||||
console.log("Skip optional script: " + script.expect)
|
||||
console.log('Skip optional script: ' + script.expect)
|
||||
found = true
|
||||
this.scripts = this.scripts.filter(x => x !== script)
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user