8000 :wrench: Auto-create themes folder if not present by yar2000T · Pull Request #962 · kando-menu/kando · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

🔧 Auto-create themes folder if not present #962

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

Merged
merged 10 commits into from
May 29, 2025
Merged
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
21 changes: 21 additions & 0 deletions src/main/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,27 @@ export class KandoApp {
},
});

try {
await fs.promises.mkdir(path.join(app.getPath('userData'), 'menu-themes'), {
recursive: true,
});
await fs.promises.mkdir(path.join(app.getPath('userData'), 'sound-themes'), {
recursive: true,
});
await fs.promises.mkdir(path.join(app.getPath('userData'), 'icon-themes'), {
recursive: true,
});
} catch (error) {
if (error.code === 'EACCES' || error.code === 'EPERM') {
console.log("Failed to create the 'themes' folder due to write-protected files.");
} else {
console.error(
'An unexpected error occurred while creating theme folders:',
error
);
}
}

// We load the settings from the user's home directory. If the settings file does
// not exist, it will be created with the default values.
this.menuSettings = new Settings<IMenuSettings>({
Expand Down
0