dashcam 0.4.1 → 0.4.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/index.js +3 -1
- package/package.json +1 -1
- package/recorder.js +9 -4
package/index.js
CHANGED
|
@@ -4,6 +4,8 @@ const fs = require("fs");
|
|
|
4
4
|
const crypto = require("crypto");
|
|
5
5
|
const lib = require("./lib");
|
|
6
6
|
const Recorder = require("./recorder");
|
|
7
|
+
const packageMetadata = require("./package.json");
|
|
8
|
+
|
|
7
9
|
|
|
8
10
|
if (module.parent) {
|
|
9
11
|
module.exports = lib;
|
|
@@ -17,7 +19,7 @@ let stdin = "";
|
|
|
17
19
|
program
|
|
18
20
|
.name("dashcam")
|
|
19
21
|
.description("Capture the steps to reproduce every bug.")
|
|
20
|
-
.version(
|
|
22
|
+
.version(packageMetadata.version);
|
|
21
23
|
|
|
22
24
|
program.showHelpAfterError();
|
|
23
25
|
|
package/package.json
CHANGED
package/recorder.js
CHANGED
|
@@ -27,10 +27,7 @@ class Recorder {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
async start() {
|
|
30
|
-
console.log(
|
|
31
|
-
"This session is being recorded by Dashcam and dumped to",
|
|
32
|
-
this.#logFile
|
|
33
|
-
);
|
|
30
|
+
console.log("This session is being recorded by Dashcam");
|
|
34
31
|
console.log("Type `exit` to stop recording");
|
|
35
32
|
|
|
36
33
|
// TODO: Find a way to consistently get the current shell this is running from
|
|
@@ -51,6 +48,14 @@ class Recorder {
|
|
|
51
48
|
// Inject a terminal variable to let the child processes know
|
|
52
49
|
// of the active recording so they we don't record recursively
|
|
53
50
|
env: { ...process.env, DASHCAM_TERMINAL_RECORDING: "TRUE" },
|
|
51
|
+
cols: process.stdout.columns,
|
|
52
|
+
rows: process.stdout.rows,
|
|
53
|
+
cwd: process.cwd(),
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
process.stdout.on("resize", () => {
|
|
57
|
+
this.#ptyProcess.cols = process.stdout.columns;
|
|
58
|
+
this.#ptyProcess.rows = process.stdout.rows;
|
|
54
59
|
});
|
|
55
60
|
|
|
56
61
|
process.stdin.on("data", this.#onInput.bind(this));
|