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

Function initTemplateDirs

lib/server-config.mjs:134–162  ·  view source on GitHub ↗

* Makes sure that the various template directories (email templates, new * account templates, etc) have been copied from the default directories to * this server's own config directory. * * @param configPath {string} Location of configuration directory (from the * local config.json file or pa

(configPath)

Source from the content-addressed store, hash-verified

132 * (new account, email, server)
133 */
134function initTemplateDirs (configPath) {
135 const accountTemplatePath = ensureDirCopyExists(
136 path.join(__dirname, '../default-templates/new-account'),
137 path.join(configPath, 'templates', 'new-account')
138 )
139
140 const emailTemplatesPath = ensureDirCopyExists(
141 path.join(__dirname, '../default-templates/emails'),
142 path.join(configPath, 'templates', 'emails')
143 )
144
145 const serverTemplatePath = ensureDirCopyExists(
146 path.join(__dirname, '../default-templates/server'),
147 path.join(configPath, 'templates', 'server')
148 )
149
150 // Ensure that the root .acl file exists,
151 // because this was not mandatory in before 5.0.0
152 ensureDirCopyExists(
153 path.join(__dirname, '../default-templates/server/.acl'),
154 path.join(configPath, 'templates', 'server', '.acl')
155 )
156
157 return {
158 account: accountTemplatePath,
159 email: emailTemplatesPath,
160 server: serverTemplatePath
161 }
162}

Callers 2

sendEmailsFunction · 0.90
updateIndex.mjsFile · 0.90

Calls 1

ensureDirCopyExistsFunction · 0.85

Tested by

no test coverage detected