Skip to content

Commit

Permalink
remove unused imports and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
gconnect committed Mar 27, 2024
1 parent 70ef55f commit 3c1d3db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
9 changes: 3 additions & 6 deletions helper/copy-template-files.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
const { ensureDir, copy } = require("fs-extra");
const {ensureDirectory} = require('../utils/directoryUtils')
const fs = require("fs-extra");
const path = require('path');
const { exludeFiles } = require("../utils/exlude-files");
const { fileURLToPath } = require('url'); // For Node.js 14+
const { installDependencies } = require("./install-dependencies")

// Function to copy template files to the project directory
async function copyTemplateFiles(templateName, destinationDir, templateDirectory) {

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

await ensureDir(destDir); // Ensure template directory exists
// Function to filter out .git, .env, node_modules, and package-lock.json files/directories
exludeFiles(templateDir, destDir)
await copy(templateDir, destDir);

console.log(`✔ Template ${templateName} created successfully!` )
// console.log(`Template files copied successfully to ${destinationDir}`);

} catch (err) {
console.error(`Error copying template files: ${err}`);
}
Expand Down
1 change: 1 addition & 0 deletions helper/install-dependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const fs = require("fs-extra")
const installDependencies = async (templateName, destinationDir, templateDirectory) => {
console.log('Installing dependencies...');
fs.ensureDir(destinationDir)
console.log(destinationDir)
process.chdir(destinationDir);
exec('npm install', (error, stdout, stderr) => {
if (error) {
Expand Down

0 comments on commit 3c1d3db

Please sign in to comment.