File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 11#!/usr/bin/env node
2+ import { existsSync } from "node:fs" ;
23import { mkdir , readFile , writeFile } from "node:fs/promises" ;
34import path from "node:path" ;
45import process from "node:process" ;
@@ -222,7 +223,12 @@ async function main() {
222223 process . exit ( 1 ) ;
223224 }
224225
225- const spec = await loadJson ( path . resolve ( String ( args . spec ) ) ) ;
226+ const specPath = path . resolve ( String ( args . spec ) ) ;
227+ if ( ! existsSync ( specPath ) ) {
228+ console . error ( `spec file not found: ${ specPath } ` ) ;
229+ process . exit ( 1 ) ;
230+ }
231+ const spec = await loadJson ( specPath ) ;
226232 const steps = Array . isArray ( spec ?. plan ?. steps ) ? spec . plan . steps : [ ] ;
227233 if ( steps . length === 0 ) {
228234 console . error ( "strategy plan.steps is required" ) ;
You can’t perform that action at this time.
0 commit comments