Skip to content

Commit 2cae58a

Browse files
committed
style: flatten
1 parent 5df8ee2 commit 2cae58a

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/utils.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,6 @@ export async function runAndRestart(message: string, fullRestart: boolean, actio
5353
let success = true
5454
try {
5555
writeFileSync(lockFile, String(Date.now()))
56-
try {
57-
logWindowOptionsChanged(fullRestart)
58-
await action()
59-
} catch (error) {
60-
logError('Fail to execute action', error)
61-
success = false
62-
} finally {
63-
try {
64-
fs.rmSync(lockFile)
65-
} catch {}
66-
}
6756
} catch (err) {
6857
if (err instanceof Error) {
6958
const base = 'This extension need to modify VSCode\'s source code but'
@@ -78,6 +67,17 @@ export async function runAndRestart(message: string, fullRestart: boolean, actio
7867
logError('Unknown error in npm:atomically', err)
7968
return
8069
}
70+
try {
71+
logWindowOptionsChanged(fullRestart)
72+
await action()
73+
} catch (err) {
74+
logError('Fail to execute action', err)
75+
success = false
76+
} finally {
77+
try {
78+
fs.rmSync(lockFile)
79+
} catch {}
80+
}
8181

8282
if (success) {
8383
let shouldProceed = false

0 commit comments

Comments
 (0)