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

pgtyped/cli v2.2.0 generate wrong path folder on windows #519

Closed
nabe1653 opened this issue May 2, 2023 · 3 comments
Closed

pgtyped/cli v2.2.0 generate wrong path folder on windows #519

nabe1653 opened this issue May 2, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@nabe1653
Copy link

nabe1653 commented May 2, 2023

Describe the bug
v2.2.0 cli uses wrong path separator on windows like this: src\controllers\system\health\getHealth.queries.ts
It creates the folder including \.

Expected behavior
Create correct path folder as same as v2.1.0 cli.
This is happened after update v2.2.0.

Test case
My environment is typescript v5.0.4, @pgtyped/runtime v2.1.0 @pgtyped/cli v2.2.0 as latest on node v18.15.0.

> pgtyped -w -c pgTyped.config.json
Saved 1 query types from src\controllers\system\health\getHealth.sql to src\controllers\system\health\getHealth.queries.ts
{
  "transforms": [
    {
      "mode": "sql",
      "include": "**/*.sql",
      "emitTemplate": "{{dir}}/{{name}}.queries.ts"
    },
  "srcDir": "./src/",
  "failOnError": false,
  "camelCaseColumnNames": true,
  ],
"db": {...}
}

I used v.2.1.0 package with typescript v5 withnpm i -f option to ignore engines error.
So only cli package version is changed from normal case project.

Thank you.

@nabe1653 nabe1653 added the bug Something isn't working label May 2, 2023
@nabe1653 nabe1653 changed the title pgtyped/cli v2.2.0 generate wrong path on windows pgtyped/cli v2.2.0 generate wrong path folder on windows May 2, 2023
@nabe1653
Copy link
Author

nabe1653 commented May 2, 2023

I feel only 1 line change will work but I don't know how to create build/test package and send MR.

image

adelsz added a commit that referenced this issue May 9, 2023
By default nunjacks escapes rendered strings which caused issues on
Windows machines.
See #519
@adelsz
Copy link
Owner

adelsz commented May 9, 2023

This should be fixed in v2.2.1.
Unfortunately I don't have a Windows machine to test and our testing pipeline relies on Docker which is unsupported on Windows.
If the issue persists, please reopen.

@adelsz adelsz closed this as completed May 9, 2023
@nabe1653
Copy link
Author

I tried cli v2.2.1 on my local windows and it works.

Thanks for quick support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants