Skip to content

Commit

Permalink
Merge pull request #2681 from jaunusa/bugfix/copyPathDepth
Browse files Browse the repository at this point in the history
fix: allow resolving copy paths for files in project root folder
  • Loading branch information
kamilmysliwiec authored Aug 9, 2024
2 parents 793f319 + 5e74583 commit f2b3d7e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/compiler/helpers/copy-path-resolve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ function dealWith(inPath: string, up: number) {
return inPath;
}

if (depth(inPath) < up) {
throw new Error('cant go up that far');
if (depth(inPath) < up - 1) {
throw new Error('Path outside of project folder is not allowed');
}

return path.join(...path.normalize(inPath).split(path.sep).slice(up));
Expand Down

0 comments on commit f2b3d7e

Please sign in to comment.