mirror of
https://github.com/karl0ss/homepage.git
synced 2025-04-29 12:03:41 +01:00
14 lines
452 B
JavaScript
14 lines
452 B
JavaScript
![]() |
import { join } from "path";
|
||
|
import { existsSync, copyFile } from "fs";
|
||
|
|
||
|
export default function checkAndCopyConfig(config) {
|
||
|
const configYaml = join(process.cwd(), "config", config);
|
||
|
if (!existsSync(configYaml)) {
|
||
|
const configSkeleton = join(process.cwd(), "src", "skeleton", config);
|
||
|
copyFile(configSkeleton, configYaml, (err) => {
|
||
|
if (err) throw err;
|
||
|
console.info("%s was copied to the config folder", config);
|
||
|
});
|
||
|
}
|
||
|
}
|