Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avro-ts-cli: Wildcard search for files doesn't work #31

Open
lajtmaN opened this issue Jun 10, 2020 · 4 comments
Open

avro-ts-cli: Wildcard search for files doesn't work #31

lajtmaN opened this issue Jun 10, 2020 · 4 comments

Comments

@lajtmaN
Copy link

lajtmaN commented Jun 10, 2020

When running the CLI using wildcard for finding avro files, it fails.

$ avro-ts avro-files/*.avsc
Converting Avro to TypeScript

internal/fs/utils.js:230
    throw err;
    ^

Error: ENOENT: no such file or directory, open 'avro-files/*.avsc'
    at Object.openSync (fs.js:457:3)
    at Object.readFileSync (fs.js:359:35)
    at %AppData%\Roaming\npm\node_modules\@ovotech\avro-ts-cli\dist\convert.js:72:55
    at Array.map (<anonymous>)

If I take one file at a time it works fine.

I'm running on Windows.

@ivank
Copy link
Contributor

ivank commented Jun 10, 2020

Oh dear yeah that might be an issue for Windows. in Linux/Mac if you do avro-ts avro-files/*.avsc what the command underneath actually receives is avro-ts avro-files/file1.avsc avro-files/file2.avsc avro-files/file3.avsc kind of thing.
As a work around you might do that for the time being, until I can come up with a way to do it on windows.
Another option is WSL, which should have all those bash goodies baked in.

@lajtmaN
Copy link
Author

lajtmaN commented Jun 11, 2020

For now, I have wrapped it in a shell script that gets all files and then runs them one by one.
But you could look at something like glob to get the files.

@pylebecq
Copy link

Hey 👋 . Not directly related to the original issue, but supporting a double-star ** could be a nice addition also, when there are multiple directories containing avro files.

avro-ts avro-files/**/*.avsc

@ivank
Copy link
Contributor

ivank commented Aug 3, 2020

I'm kind of reluctant to add support for that inside of node itself, mainly because the libraries usually bring an ungodly number of dependencies themselves. Though I might just add the one that's most popular as you would be having it anyway, and it would only be for the CLI package.

avro-ts avro-files/**/*.avsc

Already works in most shells anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants