From b2289caf2ed2d24d419e72c9b2d5043d8af8ebd5 Mon Sep 17 00:00:00 2001 From: Bronley Plumb Date: Sun, 28 Jan 2024 16:29:41 -0500 Subject: [PATCH] Sets `stagingDir` properly in DebugConfigurationProvider (#543) --- src/DebugConfigurationProvider.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/DebugConfigurationProvider.ts b/src/DebugConfigurationProvider.ts index ad2eacfb..3e930fca 100644 --- a/src/DebugConfigurationProvider.ts +++ b/src/DebugConfigurationProvider.ts @@ -89,8 +89,9 @@ export class BrightScriptDebugConfigurationProvider implements DebugConfiguratio // merge user and workspace settings into the config result = this.processUserWorkspaceSettings(config); - //force a specific staging folder path because sometimes this conflicts with bsconfig.json - result.stagingFolderPath = path.join('${outDir}/.roku-deploy-staging'); + //force a specific stagingDir because sometimes this conflicts with bsconfig.json + result.stagingDir = path.join('${outDir}/.roku-deploy-staging'); + result.stagingFolderPath = result.stagingDir; result = await this.sanitizeConfiguration(result, folder); result = await this.processEnvFile(folder, result); @@ -364,6 +365,14 @@ export class BrightScriptDebugConfigurationProvider implements DebugConfiguratio config.stagingFolderPath = path.normalize(config.stagingFolderPath.replace('${workspaceFolder}', folderUri.fsPath)); } + if (config.stagingDir.includes('${outDir}')) { + config.stagingDir = path.normalize(config.stagingDir.replace('${outDir}', config.outDir)); + } + if (config.stagingDir.includes('${workspaceFolder}')) { + config.stagingDir = path.normalize(config.stagingDir.replace('${workspaceFolder}', folderUri.fsPath)); + } + + // Make sure that directory paths end in a trailing slash if (config.debugRootDir) { config.debugRootDir = this.util.ensureTrailingSlash(config.debugRootDir);