Skip to content

Commit

Permalink
Put back more code
Browse files Browse the repository at this point in the history
  • Loading branch information
MilapNaik committed Dec 4, 2023
1 parent eeabd68 commit b89128b
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/RokuDeploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,23 @@ export class RokuDeploy {
throw new Error(`Invalid type for "dest" at index ${i} of files array`);
}

if (typeof entry.src !== 'string' && !Array.isArray(entry.src)) {
//objects with src: string
if (typeof entry.src === 'string') {
result.push({
src: util.standardizePath(entry.src),
dest: util.standardizePath(entry.dest)
});

//objects with src:string[]
} else if ('src' in entry && Array.isArray(entry.src)) {
//create a distinct entry for each item in the src array
for (let srcEntry of entry.src) {
result.push({
src: util.standardizePath(srcEntry),
dest: util.standardizePath(entry.dest)
});
}
} else {
throw new Error(`Invalid type for "src" at index ${i} of files array`);
}
} else {
Expand Down

0 comments on commit b89128b

Please sign in to comment.