diff --git a/src/RokuDeploy.spec.ts b/src/RokuDeploy.spec.ts index 43ef5c8..f34c411 100644 --- a/src/RokuDeploy.spec.ts +++ b/src/RokuDeploy.spec.ts @@ -3018,6 +3018,19 @@ describe('index', () => { }); describe('getDestPath', () => { + it('handles absolute paths properly', () => { + expect( + rokuDeploy.getDestPath( + s`${tempDir}/rootDir/source/main.bs`, + [{ + src: `${tempDir}/rootDir/source/main.bs`, + dest: 'source/standalone.brs' + }], + `${tempDir}/src/lsp/standalone-project-1` + ) + ).to.equal(s`source/standalone.brs`); + }); + it('handles unrelated exclusions properly', () => { expect( rokuDeploy.getDestPath( diff --git a/src/RokuDeploy.ts b/src/RokuDeploy.ts index 64e956b..51dd340 100644 --- a/src/RokuDeploy.ts +++ b/src/RokuDeploy.ts @@ -228,13 +228,11 @@ export class RokuDeploy { function makeGlobAbsolute(pattern: string) { return path.resolve( - path.posix.join( - rootDir, - //remove leading exclamation point if pattern is negated - pattern - //coerce all slashes to forward - ) - ).replace(/\\/g, '/'); + rootDir, + //remove leading exclamation point if pattern is negated + pattern + //coerce all slashes to forward + ).replace(/\\+/g, '/'); } let result: string;