mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Corrects Web Build Pipeline ENOENT Error (#17656)
* Checks for successful directory creation * Revert "Checks for successful directory creation" This reverts commit 372409ef323f0d82e11992bc7bc33d607a7d5581. * Checks for the existence of the logs directory before accessing. * Adds SQL carbon edit comment * Removing call to copy from non-existing directory. * Removes unneeded import * Checks for file existence before copying. * Provides explanation for modification * Replaces file existence check with exception handling.
This commit is contained in:
@@ -279,7 +279,19 @@ after(async function () {
|
|||||||
if (opts.log) {
|
if (opts.log) {
|
||||||
const logsDir = path.join(userDataDir, 'logs');
|
const logsDir = path.join(userDataDir, 'logs');
|
||||||
const destLogsDir = path.join(path.dirname(opts.log), 'logs');
|
const destLogsDir = path.join(path.dirname(opts.log), 'logs');
|
||||||
await new Promise((c, e) => ncp(logsDir, destLogsDir, err => err ? e(err) : c(undefined)));
|
|
||||||
|
// {{ SQL CARBON EDIT }}
|
||||||
|
/**
|
||||||
|
* The logs directory is not present during the ADS web build, but is during the Darwin build.
|
||||||
|
* In situations where the directory is missing and a copy attempt is made, bash exits with code 255 and raises an error
|
||||||
|
* explaining that there's no such file or directory. This prevents that error from occurring.
|
||||||
|
*/
|
||||||
|
try {
|
||||||
|
await new Promise((c, e) => ncp(logsDir, destLogsDir, err => err ? e(err) : c(undefined)));
|
||||||
|
}
|
||||||
|
catch (ex) {
|
||||||
|
console.warn(`Caught exception from ncp: ${ex}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await new Promise((c, e) => rimraf(testDataPath, { maxBusyTries: 10 }, err => err ? e(err) : c(undefined)));
|
await new Promise((c, e) => rimraf(testDataPath, { maxBusyTries: 10 }, err => err ? e(err) : c(undefined)));
|
||||||
|
|||||||
Reference in New Issue
Block a user