Skip to content

Commit

Permalink
Merge pull request #3097 from evidence-dev/fix/source-creation
Browse files Browse the repository at this point in the history
chore: handle malformed source directories
  • Loading branch information
zachstence authored Feb 13, 2025
2 parents b580ac8 + e79b8b1 commit 2d50ad0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/cool-vans-lick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@evidence-dev/sdk': patch
---

Handle malformed source directories when creating new sources
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ export const writeSourceConfig = async (options, source, spinner) => {
yaml.stringify(encodeBase64Deep(secrets))
].join('\n');

if (!source.dir) {
if (
!source.dir ||
!path.dirname(source.dir).startsWith(sourcesDirectory) ||
!path.isAbsolute(source.dir)
) {
source.dir = path.join(sourcesDirectory, source.name);
}

Expand Down

0 comments on commit 2d50ad0

Please sign in to comment.