Skip to content
This repository has been archived by the owner on Jul 14, 2020. It is now read-only.

Commit

Permalink
Now resets and cleans on failed pull. Fixes #12.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ændrew Rininsland committed Feb 10, 2017
1 parent a90f2df commit 818faa8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -36,6 +36,7 @@
},
"devDependencies": {
"babel-eslint": "^6.1.2",
"babel-preset-stage-0": "^6.16.0",
"devtron": "^1.1.0",
"electron-compilers": "^3.1.6",
"electron-packager": "^7.6.0",
Expand Down
13 changes: 12 additions & 1 deletion src/manageVisualVocabularyRepo.js
Expand Up @@ -50,7 +50,18 @@ function manageVisualVocabularyRepo(data, win) {

// Pull from GitHub
Git.pull(error => {
if (error) console.error(error);
if (error) {
// This is likely a merge conflict due to weirdness in the Visual Vocab dir
if (error.match('overwritten by merge')) {
Git.reset('hard', err => {
if (err) console.error(err);
Git.clean('f', ['-d'], (err2) => {
if (err) console.error(err2);
else Git.pull(console.error);
});
});
}
}
})
.then(() => {
console.info('Update done');
Expand Down

0 comments on commit 818faa8

Please sign in to comment.