Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/RokuDeploy.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
12 changes: 5 additions & 7 deletions src/RokuDeploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down