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.
17 lines
520 B
17 lines
520 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) {
|
|
console.log("error copying config", err);
|
|
throw err;
|
|
}
|
|
console.info("%s was copied to the config folder", config);
|
|
});
|
|
}
|
|
}
|