-
Notifications
You must be signed in to change notification settings - Fork 18
Update index.js New filename and process.platform #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- (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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- (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.