* 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)
| 43 | * @return {string} Returns the absolute path for `toDir` |
| 44 | */ |
| 45 | function 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 |
no outgoing calls
no test coverage detected