mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-11-30 18:14:29 +03:00
fix(electron): ignore .DS_Store on MacOS (#2203)
This commit is contained in:
parent
12b61d34c3
commit
5a881ec223
@ -8,7 +8,11 @@ import type { AppContext } from '../context';
|
|||||||
export async function listWorkspaces(context: AppContext) {
|
export async function listWorkspaces(context: AppContext) {
|
||||||
const basePath = path.join(context.appDataPath, 'workspaces');
|
const basePath = path.join(context.appDataPath, 'workspaces');
|
||||||
try {
|
try {
|
||||||
return fs.readdir(basePath);
|
return fs
|
||||||
|
.readdir(basePath, {
|
||||||
|
withFileTypes: true,
|
||||||
|
})
|
||||||
|
.then(dirs => dirs.filter(dir => dir.isDirectory()).map(dir => dir.name));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error('listWorkspaces', error);
|
logger.error('listWorkspaces', error);
|
||||||
return [];
|
return [];
|
||||||
|
Loading…
Reference in New Issue
Block a user