MCPcopy Index your code
hub / github.com/nodeSolidServer/node-solid-server / ensureDirCopyExists

Function ensureDirCopyExists

lib/server-config.mjs:45–54  ·  view source on GitHub ↗

* Ensures that a directory has been copied / initialized. Used to ensure that * account templates, email templates and default apps have been copied from * their defaults to the customizable config directory, at server startup. * * @param fromDir {string} Path to copy from (defaults) * * @para

(fromDir, toDir)

Source from the content-addressed store, hash-verified

43 * @return {string} Returns the absolute path for `toDir`
44 */
45function ensureDirCopyExists (fromDir, toDir) {
46 fromDir = path.resolve(fromDir)
47 toDir = path.resolve(toDir)
48
49 if (!fs.existsSync(toDir)) {
50 fs.copySync(fromDir, toDir)
51 }
52
53 return toDir
54}
55
56/**
57 * Creates (copies from the server templates dir) a Welcome index page for the

Callers 2

initDefaultViewsFunction · 0.85
initTemplateDirsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected