jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.56k stars 4.02k forks source link

Entity subgenerator fails in cygwin when --auto-crlf is specified #23840

Closed mbrandl87 closed 1 year ago

mbrandl87 commented 1 year ago
Overview of the issue

When I try to generate a new Entity or regenerate an existing one, in conjunction with the --auto-crlf option, the generator bails out with $somefile is outside of repository. If I omit the option it works, regenerating to much because of the CRLFs.

√ applying multi-step templates
√ adding package-info.java files
ERROR! ERROR! fatal: 'E:\projekte\test\.yo-rc.json' is outside repository at '/cygdrive/e/projekte/test'

GitError: fatal: 'E:\projekte\test\.yo-rc.json' is outside repository at '/cygdrive/e/projekte/test'

    at Object.action (file:///C:/cygwin64/home/m.brandl/.nvm/versions/node/v18.17.1/bin/node_modules/generator-jhipster/node_modules/simple-git/dist/esm/index.js:3824:25)
    at PluginStore.exec (file:///C:/cygwin64/home/m.brandl/.nvm/versions/node/v18.17.1/bin/node_modules/generator-jhipster/node_modules/simple-git/dist/esm/index.js:3851:25)
    at file:///C:/cygwin64/home/m.brandl/.nvm/versions/node/v18.17.1/bin/node_modules/generator-jhipster/node_modules/simple-git/dist/esm/index.js:1271:43
    at new Promise (<anonymous>)
    at GitExecutorChain.handleTaskData (file:///C:/cygwin64/home/m.brandl/.nvm/versions/node/v18.17.1/bin/node_modules/generator-jhipster/node_modules/simple-git/dist/esm/index.js:1269:16)
    at GitExecutorChain.<anonymous> (file:///C:/cygwin64/home/m.brandl/.nvm/versions/node/v18.17.1/bin/node_modules/generator-jhipster/node_modules/simple-git/dist/esm/index.js:1253:44)
    at Generator.next (<anonymous>)
    at fulfilled (file:///C:/cygwin64/home/m.brandl/.nvm/versions/node/v18.17.1/bin/node_modules/generator-jhipster/node_modules/simple-git/dist/esm/index.js:50:24)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  task: {
    commands: [
      'check-attr',
      'binary',
      'eol',
      '--',
      'E:\\projekte\\test\\.yo-rc.json'
    ],
    format: 'utf-8',
    parser: [Function: parser]
  }
}
Motivation for or Use Case

Due to Eclipse constantly changing LF to CRLF although told to use LF, we need the possibility to let JHipster use CRLF in our windows workspaces.

Reproduce the error

In Cygwin run jhipster entity Bla --auto-crlf Answer yes to regenerate, or just at any field so it has something to generate here :)

From cmd or Powershell it doesn't work at all at the moment, I'm getting hit by #22979

Suggest a Fix
JHipster Version(s)

8.0-beta.3

**JH├─┬ generator-jhipster-entity-audit@5.0.0-beta.1 extraneous

│ └── generator-jhipster@8.0.0-beta.3 deduped └── generator-jhipster@8.0.0-beta.3



##### **Entity configuration(s) `entityName.json` files generated in the `.jhipster` directory**

<!--
If the error is during an entity creation or associated with a specific entity.
If you are using JDL, please share that configuration as well.
-->

##### **Browsers and Operating System**

windows 10 X 64

- [X] Checking this box is mandatory (this is just to show you read everything)

<!-- Love JHipster? Please consider supporting our collective:
👉  https://opencollective.com/generator-jhipster/donate -->
mshima commented 1 year ago

From cmd or Powershell it doesn't work at all at the moment, I'm getting hit by #22979

This bug is supposed to be fixed. You should open a new issue with a reproduction.

mshima commented 1 year ago

Autocrlf now uses relative path. This issue is probably fixed.