Skip to content

Commit

Permalink
chore: update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon-He95 committed Feb 7, 2024
1 parent 3cc9e02 commit 74f8199
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"@antfu/eslint-config": "^0.38.4",
"@types/node": "^18.15.11",
"@types/vscode": "^1.77.0",
"@vscode-use/utils": "^0.0.36",
"@vscode-use/utils": "^0.0.82",
"bumpp": "^9.1.0",
"eslint": "^8.37.0",
"esno": "^0.16.3",
Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,20 @@ import { rimraf } from 'rimraf'
import type { ExtensionContext, Uri } from 'vscode'

export function activate(context: ExtensionContext) {
let cacheMap: Uri[] = []
context.subscriptions.push(
registerCommand('fastEmpty.delete', (current, selections: Uri[]) => {
const start = Date.now()
if (cacheMap.includes(current)) {
message.warn(`${current} 正在删除中,请不要重复删除`)
return
}
rimraf(selections.map(item => item.fsPath)).then((isSuccess) => {
message.info(isSuccess ? `删除成功 🎉 (${(Date.now() - start) / 1000}s)` : '删除失败 ❌')
cacheMap = cacheMap.filter(cache => !selections.includes(cache))
}).catch((err) => {
message.error(`删除失败 ❌ ${err}`)
cacheMap = cacheMap.filter(cache => !selections.includes(cache))
})
}),
)
Expand Down

0 comments on commit 74f8199

Please sign in to comment.