X-Git-Url: https://git.r.bdr.sh/rbdr/blog/blobdiff_plain/a5315f49f6b16c892f00509e2a27117ffd167936..f6a545b00a4046879b7cc25c06c37bb6b6880b43:/lib/remotes/git.js?ds=sidebyside diff --git a/lib/remotes/git.js b/lib/remotes/git.js index 32230ae..75ef43e 100644 --- a/lib/remotes/git.js +++ b/lib/remotes/git.js @@ -1,12 +1,12 @@ -const { exec } = require('child_process'); -const { promisify } = require('util'); +import { exec } from 'child_process'; +import { promisify } from 'util'; const internals = { // Promisified functions - exec: promisify(exec), + exec: promisify(exec) }; -module.exports = { +export default { canHandle() { // For the future: actually check if it's a valid git url @@ -28,7 +28,8 @@ module.exports = { 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`); } -} +};