You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
452 B
14 lines
452 B
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);
|
|
});
|
|
}
|
|
}
|