diff --git a/src/gist-mirror.ts b/src/gist-mirror.ts index 6bcf448..b4e3093 100644 --- a/src/gist-mirror.ts +++ b/src/gist-mirror.ts @@ -51,6 +51,15 @@ interface GistMirrorConfig { // Clone gist await exec(`git clone -q git@gist.github.com:${id}.git`); + // Wipe gist + const gistFiles = await glob(`${id}/**`); + console.log('Wiping gist'); + for (let filePath of gistFiles.slice(1)) { + const file = basename(filePath); + console.log(`\t${file}`); + await remove(resolve(gistDir, file)); + } + // Copy in files and overwrite existing console.log('Copying files'); for (let filePath of filesPaths) {