mirror of
https://github.com/gethomepage/homepage.git
synced 2025-12-07 09:35:54 -08:00
first public source commit
This commit is contained in:
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);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user