-
Notifications
You must be signed in to change notification settings - Fork 149
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
join command with wildcard does not collect matching files #1196
Comments
Hello! Let us check this. |
Hi @vip32, We've attempted to replicate this matter on both Mac and Windows machines, but unfortunately, we haven't been able to encounter the same issue. Thus, could you please consider sharing with us a sample project that demonstrates this issue? This would enable us to conduct a more in-depth investigation from our side. |
Thanks for taking time for this, interesting it works in your sample though. I extracted the files and created a small repo with only the yaml files: https://github.com/vip32/openapi_tmp executing |
Thanks for reporting @vip32! I believe this is specific to Windows command line. We will check if it could be fixed a bit later. |
with docker (on windows) the result is the same |
In Windows shells the wildcard is resolved to first match only. Fix proposed in |
The issues is in return glob.hasMagic(aliasOrPath) && !isAbsoluteUrl(aliasOrPath)
? (await require("util").promisify(glob)(aliasOrPath)).map((g: string) => getAliasOrPath(config, g))
: getAliasOrPath(config, aliasOrPath); Or just use the newer Do you want me to create a PR for this? |
That's not entirely accurate. In Windows the wildcards are not resolved by the system when passed as part of an argument. Instead commands or apps resolve wildcards themselves (in case of Node.js application they usually use The I will try to create a PR to fix this when I have the time this week. My Windows build isn't working because if this, and I am stuck with Ubuntu WSL, which I am not particularly fond of :D |
When Git Bash is not a viable option, PowerShell will work, too, as a workaround.
|
This also fails in @romanpryshliak I believe that this works for you because the The issue is actually in the section: if (argv.apis.length < 2) {
return exitWithError(`At least 2 apis should be provided.`);
} The user is passing in a glob so it will always fail at this step if it's not expanded by their shell. |
Describe the bug
When using the join command with a file wildcard the following error is always returned:
At least 2 apis should be provided.
To Reproduce
Steps to reproduce the behavior:
npx --yes @redocly/cli@latest join ./*.yaml -o ./OpenAPI.yaml
At least 2 apis should be provided.
Expected behavior
the files matching the wildcard should be used for joining. When using the following command (non wildcard) the join works correctly:
npx --yes @redocly/cli@latest join .\Identity-OpenAPI.yaml .\Shopping-OpenAPI.yaml -o ./OpenAPI.yaml
success: ./OpenAPI.yaml: join processed in 49ms
Redocly Version(s)
1.0.0 on win10
Node.js
Version(s)v19.9.0
The text was updated successfully, but these errors were encountered: