1

When I run the following in jhipster-generator's /cli directory:

cd cli
node jhipster.js

I'm generating the application in the same directory (cli). How would I change this directory to somewhere else? For example, export all the generated files into a specific directory.

I believe the directory has something to do with this line of code in jhipster.js:

const localCLI = require.resolve(path.join(process.cwd(), 'node_modules', 'generator-jhipster', 'cli', 'cli.js'));

Note: I'm not running the application with "jhipster" command.

jche
  • 129
  • 2
  • 16
  • This line is not related to creating a directory which is done by calling `mkdir`, it's used to load the generator code. I recommend that you learn about javascript and node modules. When you create a new JHipster you must go to the folder where you want to create the app, then it will generate the files and run `npm install` to install generator-jhipster and its dependencies in the project node_modules. This enables to use different versions of JHipster for different projects. I also recommend that you use node debugger to run JHipster so that you understand what's going on. – Gaël Marziou Jul 09 '19 at 21:20
  • I don't want to manually create a new folder and run jhipster in it. How would I export the generated files into a specific directory? – jche Jul 09 '19 at 22:40
  • Suppose there is already an existing directory called example, how would I export all the generated files into that folder? – jche Jul 09 '19 at 22:47
  • Your write a wrapper that does it for you. Excuse me to ask but what is your level in terms of programming ? Maybe you should ask your questions on https://gitter.im/jhipster/generator-jhipster rather than on stackoverflow where they seem a bit off topic. – Gaël Marziou Jul 09 '19 at 23:48
  • Sorry, i'm developing enterprise software for a company and required to customize JHipster based on its requirements. Since I'm not familiar with nodejs and it's my first time working with a large codebase, i'm struggling a bit. I'm currently a college student, so my level of programming is quite low. – jche Jul 10 '19 at 00:21
  • JHipster is not a large codebase and before committing to your task start by learning the technology. Customizing JHipster can be done in several ways: creating a module (https://www.jhipster.tech/modules/creating-a-module/#-creating-a-module), a blueprint (https://www.jhipster.tech/modules/creating-a-blueprint/#-creating-a-blueprint) or modifying it. The last option is the worst because it means that you won't benefit of JHipster evolutions. – Gaël Marziou Jul 10 '19 at 00:32

0 Answers0