hubot 11.2.0 → 11.2.2

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
@@ -39,6 +39,8 @@ See the [LICENSE](LICENSE.md) file for license rights and limitations (MIT).
39
39
 
40
40
  # Hubot History
41
41
 
42
+ [Say hello to Hubot](https://github.blog/2011-10-25-say-hello-to-hubot/)
43
+
42
44
  [Cartoon with Hubot](https://www.youtube.com/watch?v=vq2jYFZVMDA&t=129s)
43
45
 
44
46
  [The Most Important Startup's Hardest Worker Isn't a Person](https://www.wired.com/2015/10/the-most-important-startups-hardest-worker-isnt-a-person/)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hubot",
3
- "version": "11.2.0",
3
+ "version": "11.2.2",
4
4
  "author": "hubot",
5
5
  "keywords": [
6
6
  "github",
@@ -92,9 +92,15 @@ class Shell extends Adapter {
92
92
  await this.receive(message)
93
93
  this.#rl.prompt()
94
94
  })
95
+
95
96
  this.#rl.on('history', async (history) => {
96
- await fs.promises.writeFile(historyPath, history.reverse().join('\n'))
97
+ if (history.length === 0) return
98
+ await fs.promises.appendFile(historyPath, `${history[0]}\n`)
97
99
  })
100
+
101
+ const existingHistory = (await fs.promises.readFile(historyPath, 'utf8')).split('\n')
102
+ existingHistory.reverse().forEach(line => this.#rl.history.push(line))
103
+
98
104
  try {
99
105
  this.#rl.prompt()
100
106
  this.emit('connected', this)