From cf0a420b1675d30aa5449ccd7bc3fa38afa5dfb0 Mon Sep 17 00:00:00 2001 From: Gabriel Dibble Date: Sat, 4 Oct 2025 17:11:08 -0700 Subject: [PATCH 1/2] Update index.js FIlename draft_info.json CapCut now uses draft_info.json as the default filename. Let's use this for the web app runner. The local script should continue to work for Windows NT. --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 8f41848..a2ddaf2 100644 --- a/index.js +++ b/index.js @@ -19,7 +19,7 @@ function msToSrt(timeInMs) { }:${seconds < 10 ? "0" + seconds : seconds},${ms}`; } -var draftFileName = "draft_content.json"; +var draftFileName = "draft_info.json"; let os = process.env.os; switch (os) { case "Windows_NT": From be84191152214db228594f3f5864c7c5098d556c Mon Sep 17 00:00:00 2001 From: Gabriel Dibble Date: Sat, 4 Oct 2025 17:14:24 -0700 Subject: [PATCH 2/2] Update index.js Use process.platform The `process.env.os` is depreciated. Use `process.platform` instead. This may return different casing, as on Mac it returns 'darwin'. To be safe, using `.toLowerCase()` with the variable, and updated the three case statements for the lowercased values. --- index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index 8f41848..2107b8b 100644 --- a/index.js +++ b/index.js @@ -19,16 +19,16 @@ function msToSrt(timeInMs) { }:${seconds < 10 ? "0" + seconds : seconds},${ms}`; } -var draftFileName = "draft_content.json"; -let os = process.env.os; +var draftFileName = "draft_info.json"; +let os = process.platform.toLowerCase(); switch (os) { - case "Windows_NT": + case "windows_nt": draftFileName = "draft_content.json"; break; - case "Darwin": + case "darwin": draftFileName = "draft_info.json"; break; - case "Linux": + case "linux": draftFileName = "draft_info.json"; } console.log("file: " + draftFileName);