Update index.js New filename and process.platform#9
Update index.js New filename and process.platform#9gdibble wants to merge 5 commits intovogelcodes:mainfrom
Conversation
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.
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.
Update index.js FIlename draft_info.json
Update index.js Use process.platform
| }:${seconds < 10 ? "0" + seconds : seconds},${ms}`; | ||
| } | ||
|
|
||
| var draftFileName = "draft_content.json"; |
There was a problem hiding this comment.
- (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.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": |
There was a problem hiding this comment.
- (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.
|
Hi @vogelcodes, first thanks for your web app to convert the json to srt. I noticed it wasn't selecting the newly named 'draft_info.json' and upon inspection, I thought this second |
|
I'm sorry for not responding. I'm not really used to deal with Merges e PR's. |
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.
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.