(moduleName)
| 51 | } |
| 52 | |
| 53 | async add (moduleName) { |
| 54 | let moduleFolder = `${global.root_path}`; |
| 55 | |
| 56 | if (moduleName !== "MagicMirror") { |
| 57 | moduleFolder = `${moduleFolder}/modules/${moduleName}`; |
| 58 | } |
| 59 | |
| 60 | try { |
| 61 | Log.info(`Checking git for module: ${moduleName}`); |
| 62 | // Throws error if file doesn't exist |
| 63 | fs.statSync(path.join(moduleFolder, ".git")); |
| 64 | |
| 65 | // Fetch the git or throw error if no remotes |
| 66 | const isGitRepo = await this.isGitRepo(moduleFolder); |
| 67 | |
| 68 | if (isGitRepo) { |
| 69 | // Folder has .git and has at least one git remote, watch this folder |
| 70 | this.gitRepos.push({ module: moduleName, folder: moduleFolder }); |
| 71 | } |
| 72 | } catch { |
| 73 | // Error when directory .git doesn't exist or doesn't have any remotes |
| 74 | // This module is not managed with git, skip |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | async getStatusInfo (repo) { |
| 79 | let gitInfo = { |
no test coverage detected