eprec 1.10.0 → 1.10.1
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.
|
@@ -1416,14 +1416,21 @@ function buildCommandPreview(
|
|
|
1416
1416
|
? sourcePath
|
|
1417
1417
|
: sourceName
|
|
1418
1418
|
return [
|
|
1419
|
-
'
|
|
1420
|
-
` --input
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
` --output
|
|
1419
|
+
'eprec edit \\',
|
|
1420
|
+
` --input ${escapeShellArg(inputPath)} \\`,
|
|
1421
|
+
` --transcript ${escapeShellArg('transcript.json')} \\`,
|
|
1422
|
+
` --edited ${escapeShellArg('transcript.txt')} \\`,
|
|
1423
|
+
` --output ${escapeShellArg(outputName)}`,
|
|
1424
1424
|
].join('\n')
|
|
1425
1425
|
}
|
|
1426
1426
|
|
|
1427
|
+
function escapeShellArg(value: string) {
|
|
1428
|
+
if (value.length === 0) {
|
|
1429
|
+
return "''"
|
|
1430
|
+
}
|
|
1431
|
+
return `'${value.replace(/'/g, "'\"'\"'")}'`
|
|
1432
|
+
}
|
|
1433
|
+
|
|
1427
1434
|
function findPreviousCut(cutRanges: CutRange[], playhead: number) {
|
|
1428
1435
|
let previous: CutRange | null = null
|
|
1429
1436
|
for (const range of cutRanges) {
|
package/package.json
CHANGED
|
@@ -70,21 +70,29 @@ function buildInstructions(options: {
|
|
|
70
70
|
transcriptTextPath: string
|
|
71
71
|
outputBasename: string
|
|
72
72
|
}): string {
|
|
73
|
+
const outputPath = path.join(options.editsDirectory, options.outputBasename)
|
|
73
74
|
return [
|
|
74
75
|
'# Manual edit workflow',
|
|
75
76
|
'',
|
|
76
77
|
'1) Edit `transcript.txt` and delete whole words only.',
|
|
77
78
|
'2) Run:',
|
|
78
79
|
'',
|
|
79
|
-
`
|
|
80
|
-
` --input
|
|
81
|
-
` --transcript
|
|
82
|
-
` --edited
|
|
83
|
-
` --output
|
|
80
|
+
` eprec edit \\`,
|
|
81
|
+
` --input ${escapeShellArg(options.originalVideoPath)} \\`,
|
|
82
|
+
` --transcript ${escapeShellArg(options.transcriptJsonPath)} \\`,
|
|
83
|
+
` --edited ${escapeShellArg(options.transcriptTextPath)} \\`,
|
|
84
|
+
` --output ${escapeShellArg(outputPath)}`,
|
|
84
85
|
'',
|
|
85
86
|
'If the transcript no longer matches, regenerate it with:',
|
|
86
87
|
'',
|
|
87
|
-
` bun process-course/edits/regenerate-transcript.ts --dir
|
|
88
|
+
` bun process-course/edits/regenerate-transcript.ts --dir ${escapeShellArg(options.editsDirectory)}`,
|
|
88
89
|
'',
|
|
89
90
|
].join('\n')
|
|
90
91
|
}
|
|
92
|
+
|
|
93
|
+
function escapeShellArg(value: string) {
|
|
94
|
+
if (value.length === 0) {
|
|
95
|
+
return "''"
|
|
96
|
+
}
|
|
97
|
+
return `'${value.replace(/'/g, "'\"'\"'")}'`
|
|
98
|
+
}
|