Skip to content

Commit

Permalink
Merge pull request #1229 from polywrap/fetsorn/1228-validation-path
Browse files Browse the repository at this point in the history
fix: validation script path should be relative to workflow manifest
  • Loading branch information
Niraj-Kamdar authored Sep 10, 2022
2 parents 453c28f + 8ce3fe7 commit 23f028a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions packages/cli/src/commands/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,11 @@ export const run: Command = {
},
};

function loadValidationScript(cueFilepath: string): string {
cueFilepath = path.resolve(cueFilepath);
function loadValidationScript(
manifestPath: string,
cueFilepath: string
): string {
cueFilepath = path.join(path.dirname(manifestPath), cueFilepath);

if (!fs.existsSync(cueFilepath)) {
console.error(
Expand All @@ -83,7 +86,7 @@ const _run = async (options: WorkflowCommandOptions) => {
const manifestPath = path.resolve(manifest);
const workflow = loadWorkflowManifest(manifestPath);
const validationScript = workflow.validation
? loadValidationScript(workflow.validation)
? loadValidationScript(manifestPath, workflow.validation)
: undefined;

const workflowOutput: (JobResult & { id: string })[] = [];
Expand Down
2 changes: 1 addition & 1 deletion packages/templates/wasm/assemblyscript/polywrap.test.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: template-wasm-rs
format: 0.1
validation: "./workflows/validation.cue"
validation: "./workflows/validator.cue"
jobs:
sampleMethod:
steps:
Expand Down

0 comments on commit 23f028a

Please sign in to comment.