Skip to content

Commit

Permalink
fix issue with directory modified template directory
Browse files Browse the repository at this point in the history
  • Loading branch information
gconnect committed Mar 27, 2024
1 parent c7fe3c0 commit 4c12f78
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
3 changes: 1 addition & 2 deletions bin/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ const { figletText } = require( "../utils/ascii-image");
const { copyGitTemplateFiles } = require("../helper/fetch-git-repo")
const { installDependencies } = require("../helper/install-dependencies")

let inquirer

async function createProject(projectName) {
inquirer = await import('inquirer');
const inquirer = await import('inquirer');

const templates = {
frontend: ['react-app', 'next-app', 'angular-app', 'vue-app'],
Expand Down
2 changes: 1 addition & 1 deletion bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const { Command } = require('commander');
const packageJson = require('../package.json');
const { createProject } = require('./create.js')
const { createProject } = require('./create')

const program = new Command();

Expand Down
3 changes: 1 addition & 2 deletions helper/copy-template-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ const { fileURLToPath } = require('url'); // For Node.js 14+
// Function to copy template files to the project directory
async function copyTemplateFiles(templateName, destinationDir, templateDirectory) {
try {

const templateDir = path.resolve(process.cwd(), templateDirectory, templateName);
const templateDir = path.resolve(__dirname,'..', templateDirectory, templateName);
const destDir = path.resolve(process.cwd(), destinationDir);

console.log('Template directory:', templateDir);
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4c12f78

Please sign in to comment.