fix(nodejs): pass --directory packages/<name> to gapic-generator-typescript#6876
fix(nodejs): pass --directory packages/<name> to gapic-generator-typescript#6876quirogas wants to merge 1 commit intogoogleapis:maingoogleapis/librarian:mainfrom quirogas:fix/nodejs-generator-directory-argquirogas/librarian:fix/nodejs-generator-directory-argCopy head branch name to clipboard
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds a --directory argument to the Node.js generator arguments and updates the corresponding unit tests. The review feedback correctly points out that using filepath.Join will produce platform-specific path separators (backslashes on Windows), which will cause test failures on Windows since the tests expect forward slashes. It is recommended to use fmt.Sprintf to ensure forward slashes are consistently used.
| } | ||
|
|
||
| args = append(args, "--package-name", derivePackageName(library)) | ||
| args = append(args, "--directory", filepath.Join("packages", library.Name)) |
There was a problem hiding this comment.
Using filepath.Join produces platform-specific path separators (backslashes on Windows). Since this is a path argument for a Node.js tool and the unit tests expect forward slashes, this will cause test failures on Windows. Use fmt.Sprintf to ensure forward slashes are always used.
| args = append(args, "--directory", filepath.Join("packages", library.Name)) | |
| args = append(args, "--directory", fmt.Sprintf("packages/%s", library.Name)) |
No description provided.