Skip to content

Relative paths are treated differently in different commands #195

@ms14981

Description

@ms14981

Assuming a file path blah/forge/openapi-forge-javascript/package.json and blah/forge/openapi-forge/package.json with the following commands run from the blah/forge/openapi-forge directory.

$ ./src/index.js generator-options ../openapi-forge-javascript
$ ./src/index.js test-generators --generators openapi-forge-javascript

We are running the commands from the same location. The generator is installed in the same directory. But the generator-options command requires ../ whereas test-generators doesn't! See also #186

To complicate matters, if openapi-forge is installed globally, then the relative path is interpreted as relative to the location that the openapi-forge global package is installed, which would only work if the generator is also installed globally:

$ openapi-forge test-generators --generators openapi-forge-javascript
Starting tests for generator openapi-forge-javascript
cd: no such file or directory: C:/Users/<username>/AppData/Roaming/npm/node_modules/openapi-forge-javascript

TODO:

  1. Change the test-generators command to be consistent with the generator-options command.
  2. Fix relative paths for global call of openapi-forge.
  3. Update the documentation!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions