Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ function msToSrt(timeInMs) {
}:${seconds < 10 ? "0" + seconds : seconds},${ms}`;
}

var draftFileName = "draft_content.json";
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. (Update index.js FIlename draft_info.json gdibble/capcut-srt-export#1 (comment))
    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.

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":
Comment on lines +23 to +31
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. (Update index.js Use process.platform gdibble/capcut-srt-export#2 (comment))
    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.

draftFileName = "draft_info.json";
}
console.log("file: " + draftFileName);
Expand Down