hubot 11.1.6 → 11.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -47,4 +47,6 @@ See the [LICENSE](LICENSE.md) file for license rights and limitations (MIT).
47
47
 
48
48
  [Hubot by Hubotics](https://www.theoldrobots.com/hubot.html)
49
49
 
50
- [Automating Inefficiencies](https://zachholman.com/2011/01/automating-inefficiencies/)
50
+ [Automating Inefficiencies](https://zachholman.com/2011/01/automating-inefficiencies/)
51
+
52
+ [Getting Started with Hubot](https://www.youtube.com/watch?v=A7fh6RIzGrw)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hubot",
3
- "version": "11.1.6",
3
+ "version": "11.1.7",
4
4
  "author": "hubot",
5
5
  "keywords": [
6
6
  "github",
@@ -75,20 +75,15 @@ class Shell extends Adapter {
75
75
  this.#rl.prompt()
76
76
  break
77
77
  }
78
+ if (input.length > 0) {
79
+ fs.appendFileSync(historyPath, `${input}\n`)
80
+ }
78
81
  const history = fs.readFileSync(historyPath, 'utf-8').split('\n').reverse()
79
82
  this.#rl.history = history
80
- this.#rl.on('line', line => {
81
- const input = line.trim()
82
- if (input.length === 0) return
83
- fs.appendFile(historyPath, `${input}\n`, err => {
84
- if (err) console.error(err)
85
- })
86
- })
87
83
  let userId = process.env.HUBOT_SHELL_USER_ID || '1'
88
84
  if (userId.match(/A\d+z/)) {
89
85
  userId = parseInt(userId)
90
86
  }
91
-
92
87
  const userName = process.env.HUBOT_SHELL_USER_NAME || 'Shell'
93
88
  const user = this.robot.brain.userForId(userId, { name: userName, room: 'Shell' })
94
89
  await this.receive(new TextMessage(user, input, 'messageId'))