mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-08 14:38:47 +00:00
first public source commit
This commit is contained in:
parent
1a4fbb9d42
commit
3914fee775
65 changed files with 4697 additions and 312 deletions
13
src/utils/config.js
Normal file
13
src/utils/config.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
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);
|
||||
});
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue