glop.dev 0.4.0 → 0.5.0
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/dist/index.js +8 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -378,16 +378,19 @@ var doctorCommand = new Command3("doctor").description("Check that glop is set u
|
|
|
378
378
|
|
|
379
379
|
// src/commands/hook.ts
|
|
380
380
|
import { Command as Command4 } from "commander";
|
|
381
|
-
import { openSync, readSync, closeSync } from "fs";
|
|
381
|
+
import { openSync, readSync, closeSync, readFileSync } from "fs";
|
|
382
382
|
function extractSlugFromTranscript(transcriptPath) {
|
|
383
383
|
try {
|
|
384
384
|
const fd = openSync(transcriptPath, "r");
|
|
385
|
-
const buf = Buffer.alloc(
|
|
386
|
-
const bytesRead = readSync(fd, buf, 0,
|
|
385
|
+
const buf = Buffer.alloc(262144);
|
|
386
|
+
const bytesRead = readSync(fd, buf, 0, 262144, 0);
|
|
387
387
|
closeSync(fd);
|
|
388
388
|
const head = buf.toString("utf-8", 0, bytesRead);
|
|
389
389
|
const match = head.match(/"slug":"([^"]+)"/);
|
|
390
|
-
|
|
390
|
+
if (match) return match[1];
|
|
391
|
+
if (bytesRead < 262144) return null;
|
|
392
|
+
const full = readFileSync(transcriptPath, "utf-8");
|
|
393
|
+
return full.match(/"slug":"([^"]+)"/)?.[1] ?? null;
|
|
391
394
|
} catch {
|
|
392
395
|
return null;
|
|
393
396
|
}
|
|
@@ -608,7 +611,7 @@ var statusCommand = new Command6("status").description("Show current Run status
|
|
|
608
611
|
// package.json
|
|
609
612
|
var package_default = {
|
|
610
613
|
name: "glop.dev",
|
|
611
|
-
version: "0.
|
|
614
|
+
version: "0.5.0",
|
|
612
615
|
type: "module",
|
|
613
616
|
bin: {
|
|
614
617
|
glop: "./dist/index.js"
|