Skip to content

Commit f6fa1b0

Browse files
committed
fix: update uninstall script
1 parent 84e3748 commit f6fa1b0

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/path.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import path from 'node:path/posix'
44
import { env, version } from 'vscode'
55

66
import { name as bakExt } from './generated/meta'
7-
import { log } from './logger'
87
import { logError } from './utils'
98

109
function getDirectoryName(filePath: string): string {

src/uninstall.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
import fs from 'node:fs'
12
import { readFileSync, writeFileSync } from 'atomically'
23

34
import * as paths from './path'
45

56
function uninstall(srcPath: string, bakPath: string) {
6-
writeFileSync(srcPath, readFileSync(bakPath, 'utf-8'))
7+
if (fs.existsSync(srcPath)) {
8+
writeFileSync(srcPath, readFileSync(bakPath, 'utf-8'))
9+
}
710
}
811

912
uninstall(

0 commit comments

Comments
 (0)