rhys-vdw / ts-auto-guard

Generate type guard functions from TypeScript interfaces
MIT License
497 stars 54 forks source link

Throw if file not found #234

Open Amatewasu opened 1 year ago

Amatewasu commented 1 year ago

Currently, if we run ts-auto-guard my-file.ts and my-file.ts is not found, ts-auto-guard outputs Done!.

It would be nice to display that the file has not been found.

rhys-vdw commented 1 year ago

@Amatewasu good idea. Would you like to open a PR? I'm sure it would be a simple fix.

Looks like it once already worked: https://github.com/rhys-vdw/ts-auto-guard/blob/c6c97c25b50e8b00d582f864b14c20e36fa23634/src/cli.ts#L128

In any case, you'll probably need to loop through the files and throw here: https://github.com/rhys-vdw/ts-auto-guard/blob/c6c97c25b50e8b00d582f864b14c20e36fa23634/src/index.ts#L1047