feat: add ctx.base.trashItem method

This commit is contained in:
purocean
2022-01-01 22:16:37 +08:00
parent 2314f0bc9a
commit 087b92bad8
+12
View File
@@ -96,6 +96,18 @@ export async function showItemInFolder (path: string) {
await api.rpc(`require('electron').shell.showItemInFolder(${quote(path)})`)
}
/**
* Trash item
* @param path
*/
export async function trashItem (path: string) {
if (isWindows) {
path = path.replaceAll('/', '\\')
}
await api.rpc(`require('electron').shell.trashItem(${quote(path)})`)
}
/**
* get repo by name
* @param name