Skip to content

Commit be11d40

Browse files
authored
Fix rename error and its message and linux build (#1462)
* Fix rename error and its message and linux build Rename was always outputting an error message since the callback is always called. Included and error check. For offline install, if opendebug.exe.config exists, rename needs to happen too. Added function call for offline installation. 'use strict' was erroring on ubuntu build in copyScript.ts
1 parent 5c8fdab commit be11d40

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Extension/src/Debugger/copyScript.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* Copyright (c) Microsoft Corporation. All Rights Reserved.
33
* See 'LICENSE' in the project root for license information.
44
* ------------------------------------------------------------------------------------------ */
5+
'use strict';
56

67
/**
78
* This file is used for packaging the application and should not be referenced

Extension/src/main.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ async function offlineInstallation(): Promise<void> {
7878
setInstallationStage('makeOfflineBinariesExecutable');
7979
await makeOfflineBinariesExecutable(info);
8080

81+
setInstallationStage('removeUnnecessaryFile');
82+
await removeUnnecessaryFile();
83+
8184
setInstallationStage('rewriteManifest');
8285
await rewriteManifest();
8386

@@ -147,7 +150,9 @@ function removeUnnecessaryFile(): Promise<void> {
147150
let sourcePath: string = util.getDebugAdaptersPath("bin/OpenDebugAD7.exe.config");
148151
if (fs.existsSync(sourcePath)) {
149152
fs.rename(sourcePath, util.getDebugAdaptersPath("bin/OpenDebugAD7.exe.config.unused"), (err: NodeJS.ErrnoException) => {
150-
getOutputChannelLogger().appendLine("removeUnnecessaryFile: fs.rename failed");
153+
if (err) {
154+
getOutputChannelLogger().appendLine(`ERROR: fs.rename failed with "${err.message}". Delete ${sourcePath} manually to enable debugging.`);
155+
}
151156
});
152157
}
153158
}

0 commit comments

Comments
 (0)