* chore: remove bin * fix: restore bin * change dist to bin * publish only dist folder * publish with src folder. * fix ci * merge steps in CI * update workflow * deploy with src * update to v9 * delete unused code * complete landing page * complete landing page * feat: webflow template (#518) * created a new branch for webflow from debug/course-app * added webflow and reverted neccessary changes * fixed commit issues * clean up posthog * clean up classic * clean up minimal * clean up posthog * clean up webflow * v0.0.10 * markdown lint * feat: add prep template (#522) * working on the ielts template * working on the ielts template * finished the ielts template --------- Co-authored-by: emmanuel <[email protected]> * clean up examprep * v0.0.11 --------- Co-authored-by: Em_Dev <[email protected]>
26 lines
811 B
TypeScript
26 lines
811 B
TypeScript
import chalk from 'chalk';
|
|
import fs from 'fs';
|
|
import path from 'path';
|
|
import { copyFolderSync } from './copyFolder';
|
|
import { CopyCourseFolderParams } from './types';
|
|
|
|
export async function copyCoursesFolder({
|
|
templatePath,
|
|
projectPath,
|
|
courses
|
|
}: CopyCourseFolderParams): Promise<void> {
|
|
const from = path.join(templatePath, 'src/courses');
|
|
const to = path.join(projectPath, 'src/courses');
|
|
|
|
// Create the 'courses' folder if it doesn't exist
|
|
fs.mkdirSync(to, { recursive: true });
|
|
|
|
if (courses && fs.existsSync(from)) {
|
|
// Copy all contents of the courses folder if courses is true
|
|
await copyFolderSync({ from, to });
|
|
} else {
|
|
// Just create an empty 'courses' folder, without copying any content
|
|
console.log(chalk.yellow(`Created empty courses folder at: ${to}`));
|
|
}
|
|
}
|