Files
Rotimi Bestandemmanuel 3ee7cf10e3 feat: course-app v0.0.11 (#523)
* 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 <chifez1@gmail.com>

* clean up examprep

* v0.0.11

---------

Co-authored-by: Em_Dev <Chifez1@gmail.com>
2024-12-17 04:06:03 +01:00

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}`));
}
}