mirror of
https://github.com/purocean/yn.git
synced 2026-09-24 15:46:02 +08:00
feat: add ctx.base.trashItem method
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user