hubot 13.0.1 → 13.0.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/CONTRIBUTING.md +1 -1
- package/package.json +1 -1
- package/src/adapters/Shell.mjs +10 -6
package/CONTRIBUTING.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Contributions to this project are [released](https://help.github.com/articles/github-terms-of-service/#6-contributions-under-repository-license) to the public under the [project's open source license](LICENSE.md).
|
|
4
4
|
|
|
5
|
-
Everyone is welcome to contribute to Hubot. Contributing doesn’t just mean submitting pull requests—there are many different ways for you to get involved, including answering questions
|
|
5
|
+
Everyone is welcome to contribute to Hubot. Contributing doesn’t just mean submitting pull requests—there are many different ways for you to get involved, including answering questions, reporting or triaging [issues](https://github.com/github/hubot/issues), and participating in using Hubot.
|
|
6
6
|
|
|
7
7
|
No matter how you want to get involved, we ask that you first learn what’s expected of anyone who participates in the project by reading the [Contributor Covenant Code of Conduct](http://contributor-covenant.org). By participating, you are expected to uphold this code.
|
|
8
8
|
|
package/package.json
CHANGED
package/src/adapters/Shell.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
import fs from 'node:fs'
|
|
4
|
+
import { stat, writeFile, unlink } from 'node:fs/promises'
|
|
4
5
|
import readline from 'node:readline'
|
|
5
6
|
import Adapter from '../Adapter.mjs'
|
|
6
7
|
import { TextMessage } from '../Message.mjs'
|
|
@@ -44,12 +45,15 @@ class Shell extends Adapter {
|
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
async run () {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
try {
|
|
49
|
+
const stats = await stat(historyPath)
|
|
50
|
+
if (stats.size > historySize) {
|
|
51
|
+
await unlink(historyPath)
|
|
52
|
+
await writeFile(historyPath, '')
|
|
53
|
+
}
|
|
54
|
+
} catch (error) {
|
|
55
|
+
console.log(error)
|
|
56
|
+
await writeFile(historyPath, '')
|
|
53
57
|
}
|
|
54
58
|
|
|
55
59
|
this.#rl = readline.createInterface({
|