From: Ruben Beltran del Rio Date: Fri, 9 Dec 2022 22:09:08 +0000 (+0100) Subject: Ignore errors on checkout X-Git-Tag: 5.0.0~10 X-Git-Url: https://git.r.bdr.sh/rbdr/blog/commitdiff_plain/b0c3bb911306b2468152cf8a83c28eca843b7647?ds=sidebyside;hp=f24ecd569d1945fbbdf18fad9398ea338d8eb2c6 Ignore errors on checkout --- diff --git a/lib/remotes/git.js b/lib/remotes/git.js index 11fdab8..c894122 100644 --- a/lib/remotes/git.js +++ b/lib/remotes/git.js @@ -24,7 +24,10 @@ module.exports = { async syncDown(remote, blogDirectory) { await internals.exec(`cd ${blogDirectory} && git init`); - await internals.exec(`cd ${blogDirectory} && git checkout .`); + try { + await internals.exec(`cd ${blogDirectory} && git checkout .`); + } + catch {} await internals.exec(`cd ${blogDirectory} && git clean . -f`); await internals.exec(`cd ${blogDirectory} && git pull ${remote} main`); }