Skip to content

Commit

Permalink
chore: add bad reference error [gh-800]
Browse files Browse the repository at this point in the history
  • Loading branch information
Nahuel Alejandro Ramos committed Aug 17, 2023
1 parent c459c19 commit 9dae1c4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/cli/src/constructs/api-check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,12 @@ export class ApiCheck extends Check {

const deps: ScriptDependency[] = []
for (const { filePath, content } of parsed.dependencies) {
const relativePath = pathToPosix(path.relative(Session.basePath!, filePath))
if (relativePath.startsWith('..')) {
throw new Error(`You cannot reference a dependency file above the Checkly config location folder. Please, modify "${relativePath}" path.`)
}
deps.push({
path: pathToPosix(path.relative(Session.basePath!, filePath)),
path: relativePath,
content,
})
}
Expand Down

0 comments on commit 9dae1c4

Please sign in to comment.