X-Git-Url: https://git.r.bdr.sh/rbdr/blog/blobdiff_plain/a5315f49f6b16c892f00509e2a27117ffd167936..36a4680d18de012e2e5c732f9db161dafa884344:/lib/remotes/git.js 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`); } -} +};