ftrackhq / ftrack-ts-schema-generator

Gets the schema from an ftrack instance and generates typescript interfaces for all the entity types in the instance.
Apache License 2.0
2 stars 1 forks source link

fix: Resolve CLI issues on Mac #10

Closed ffMathy closed 1 year ago

ffMathy commented 1 year ago

Changes

On Mac, the include path check did not work for me.

Context: https://stackoverflow.com/questions/6398196/detect-if-called-through-require-or-directly-by-command-line

I followed the above changes.

Test

  1. Clone this repo. The following commands are then run in that repo folder.
  2. Run yarn install.
  3. Run npm link.
  4. Run npm run watch to build and watch for changes.
  5. Start another project. The following commands are then run in that project.
  6. Install @ftrack/ts-schema-generator into the project from NPM.
  7. Run npm link @ftrack/ts-schema-generator to symbiotically link the project's ts-schema-generator to the repo's folder.
  8. Execute the generator via the following scripts command: "ftrack:schema": "ftrack-ts-schema-generator ./ftrack schema.ts"
ffMathy commented 1 year ago

By the way, this is the pull request I was describing: https://github.com/ftrackhq/ftrack-javascript/pull/97

gismya commented 1 year ago

I removed the export from the generate function and ran the prettier formatting

ffMathy commented 1 year ago

Ah yes. I always forget that 😂 thanks! 🙏