| … | … | @@ -177,11 +177,13 @@ async function appInstallGit (repoName, flags) { |
| 177 | 177 | const oldVersion = pkg.version || 'unknown' |
| 178 | 178 | |
| 179 | 179 | if (existsSync(path.join(installDir, '.git'))) { |
| 180 | | // Git-cloned install — update via git pull |
| 181 | | log(name + ' v' + oldVersion + ' already installed, updating...') |
| 180 | // Git-cloned install — update from local bare repo (synced via federation) |
| 181 | const localBareRepo = path.join(HOME, 'git-repos', repoName + '.git') |
| 182 | const fetchSource = existsSync(localBareRepo) ? localBareRepo : 'origin' |
| 183 | log(name + ' v' + oldVersion + ' already installed, updating from ' + (fetchSource === 'origin' ? 'P2P origin' : 'local bare repo') + '...') |
| 182 | 184 | try { |
| 183 | | await execGitInDir(installDir, ['fetch', 'origin', 'release', '--depth', '1']) |
| 184 | | await execGitInDir(installDir, ['reset', '--hard', 'origin/release']) |
| 185 | await execGitInDir(installDir, ['fetch', fetchSource, 'release', '--depth', '1']) |
| 186 | await execGitInDir(installDir, ['reset', '--hard', 'FETCH_HEAD']) |
| 185 | 187 | } catch (err) { |
| 186 | 188 | error('Git update failed: ' + err.message) |
| 187 | 189 | } |