* 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)
| 132 | * (new account, email, server) |
| 133 | */ |
| 134 | function 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 | } |
no test coverage detected