Skip to content

Commit d71a699

Browse files
committed
Merge branch 'release/0.6.4'
2 parents bbbc19d + af3c8dc commit d71a699

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "ovm",
33
"description": "Obsidian Vaults Manager",
44
"type": "commonjs",
5-
"version": "0.6.3",
5+
"version": "0.6.4",
66
"license": "GPL-3.0-only",
77
"author": "Masoud Ghorbani",
88
"homepage": "https://github.com/msudgh/ovm",

src/providers/plugins.ts

+8-5
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ export const removePluginDir = async (pluginId: string, vaultPath: string) => {
1919
childLogger.debug(`Remove plugin`)
2020

2121
await rm(pluginDir, { recursive: true, force: true })
22-
await modifyCommunityPlugins({ id: pluginId }, vaultPath, 'disable')
2322

2423
childLogger.debug(`Removed plugin`)
2524
}
@@ -30,11 +29,15 @@ export const listInstalledPlugins = async (vaultPath: string) => {
3029

3130
await access(pluginsPath, constants.R_OK)
3231

33-
const existingDirs = await readdir(pluginsPath)
32+
const entries = await readdir(pluginsPath, {
33+
withFileTypes: true,
34+
})
3435

35-
installedPlugins = existingDirs.map((plugin) => ({
36-
id: plugin,
37-
}))
36+
installedPlugins = entries
37+
.filter(({ isDirectory }) => isDirectory())
38+
.map((dir) => ({
39+
id: dir.name,
40+
}))
3841

3942
return installedPlugins
4043
}

src/services/prune.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import { ArgInput } from '@oclif/core/lib/parser'
22
import { each } from 'async'
3-
import { listInstalledPlugins, removePluginDir } from '../providers/plugins'
3+
import {
4+
listInstalledPlugins,
5+
modifyCommunityPlugins,
6+
removePluginDir,
7+
} from '../providers/plugins'
48
import { getSelectedVaults, mapVaultsIteratorItem } from '../providers/vaults'
59
import {
610
FactoryFlagsWithVaults,
@@ -28,6 +32,7 @@ const pruneVaultIterator: PruneCommandIterator = async (item) => {
2832

2933
for (const plugin of toBePruned) {
3034
await removePluginDir(plugin.id, vault.path)
35+
await modifyCommunityPlugins({ id: plugin.id }, vault.path, 'disable')
3136
}
3237

3338
childLogger.info(`Pruned ${toBePruned.length} plugins`, {

0 commit comments

Comments
 (0)