Skip to content

Commit 2c7f399

Browse files
committed
fix: Ensure, that the "keys" instruction types the string parameter as plain text; only an array of strings should be handled as named key strokes
1 parent 2f831ae commit 2c7f399

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tasks/instructions/keys.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,14 @@ module.exports = {
66
},
77

88
perform: function (grunt, target, client, command) {
9-
const keys = command.keys
10-
const message = Array.isArray(keys)
9+
let keys = command.keys
10+
const separateKeys = Array.isArray(keys)
11+
const message = separateKeys
1112
? 'Send keys "' + keys.join('", "') + '".'
12-
: 'Send test "' + keys + '".'
13+
: 'Send text "' + keys + '".'
14+
if (!separateKeys) {
15+
keys = keys.split('')
16+
}
1317
grunt.verbose.writeln(message)
1418
return client.keys(keys)
1519
}

0 commit comments

Comments
 (0)