Skip to content

Commit cc451d2

Browse files
committed
not backup file for KEIL_C51 -> SDCC converter
1 parent e511ce3 commit cc451d2

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

src/extension.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1898,30 +1898,19 @@ function c51ToSDCC() {
18981898
}
18991899

19001900
const file = new File(vscode.window.activeTextEditor.document.uri.fsPath);
1901-
const bkFile = new File(file.path + '.bk');
1902-
19031901
if (file.IsFile()) {
19041902
try {
1905-
// backup
1906-
fs.copyFileSync(file.path, bkFile.path);
1907-
19081903
const res: string[] = [];
19091904
sfrMap.clear();
19101905
const lines = fs.readFileSync(file.path, 'utf8').split(/\n|\r\n/);
1911-
19121906
lines.forEach((_line, index) => {
19131907
res.push(handleLine(_line, index + 1));
19141908
});
1915-
19161909
fs.writeFileSync(file.path, res.join(os.EOL));
1917-
1918-
GlobalEvent.emit('msg', newMessage('Info', 'Convert finished !'));
1919-
1910+
GlobalEvent.emit('msg', newMessage('Info', 'Convertion finished !'));
19201911
} catch (error) {
19211912
GlobalEvent.emit('msg', ExceptionToMessage(error, 'Warning'));
19221913
}
1923-
} else {
1924-
GlobalEvent.emit('msg', newMessage('Warning', 'not found file: \'' + file.path + '\''));
19251914
}
19261915
}
19271916
}

0 commit comments

Comments
 (0)