From d234716e707d368f13795ad21535829dcce7d413 Mon Sep 17 00:00:00 2001 From: Randy Eckman Date: Fri, 8 Dec 2023 22:28:25 -0600 Subject: [PATCH] updates to correct linter slashes for mixed platform projects --- src/lint/provider.ts | 1 + src/util/glob-paths.ts | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lint/provider.ts b/src/lint/provider.ts index 8a7b9c9c..c3a071d7 100644 --- a/src/lint/provider.ts +++ b/src/lint/provider.ts @@ -495,6 +495,7 @@ export class FortranLintingProvider { if (!modout) return []; modout = resolveVariables(modout); + if (process.platform === 'win32') modout = modout.replace(/\//g, '\\'); this.logger.debug(`[lint] moduleOutput: ${modFlag} ${modout}`); return [modFlag, modout]; } diff --git a/src/util/glob-paths.ts b/src/util/glob-paths.ts index 743d0ba3..de4c7528 100644 --- a/src/util/glob-paths.ts +++ b/src/util/glob-paths.ts @@ -34,9 +34,9 @@ export class GlobPaths { private globResolution(globPaths: string[]): string[] { if (globPaths.length === 0) return []; // Resolve internal variables and expand glob patterns - const globPathsVars = globPaths.map(e => resolveVariables(e)); + globPaths = globPaths.map(e => resolveVariables(e)); // fast-glob cannot work with Windows paths - globPaths = globPaths.map(e => e.replace('/\\/g', '/')); + globPaths = globPaths.map(e => e.replace(/\\/g, '/')); // This needs to be after the resolvevariables since {} are used in globs // try { // const globIncPaths: string[] = fg.sync(globPathsVars, { @@ -49,7 +49,7 @@ export class GlobPaths { // } catch (eacces) { try { const globIncPaths: string[] = []; - for (const i of globPathsVars) { + for (const i of globPaths) { // use '/' to match only directories and not files globIncPaths.push(...glob.sync(i + '/')); }