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

pal g only works if the prisma.schema file is saved as LF (linux default) #294

Open
Mu4all opened this issue Jan 31, 2023 · 1 comment
Open

Comments

@Mu4all
Copy link

Mu4all commented Jan 31, 2023

I'm just a noob, working on windows and I had it saved in CRLF. It does not throw an error, but it only generated the graphql stuff and not the admin pieces.

Due to some wonky regexp in PrismaReader.js this fails.

    get models() {
        return this.data.match(/\n(model(\s)[\s\S]*?})\n/g);
    }
    get enums() {
        return this.data.match(/\n(enum(\s)[\s\S]*?})\n/g);
    }

What would work is (I tested it)

    get models() {
        return this.data.match(/>\r?\n(model(\s)[\s\S]*?})\r?\n/g);
    }
    get enums() {
        return this.data.match(/\r?\n(enum(\s)[\s\S]*?})\r?\n/g);
    }
@AhmedElywa
Copy link
Collaborator

please open pull request with your change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants