[Base] Force rm clone dir if exists

This commit is contained in:
Ducko 2021-03-07 20:13:00 +00:00 committed by フズキ
parent 32eebc02b3
commit 3487624ac0
No known key found for this signature in database
GPG Key ID: AD7750AB4625F1DD
1 changed files with 3 additions and 1 deletions

View File

@ -6,7 +6,7 @@ import Parcel from 'parcel-bundler';
import axios from 'axios';
import glob from 'glob';
import { rmSync, mkdirSync, readFileSync, writeFileSync, copyFileSync, existsSync } from 'fs';
import { rmSync, mkdirSync, readFileSync, writeFileSync, copyFileSync, existsSync, rmdirSync } from 'fs';
import { createHash } from 'crypto';
import { dirname } from 'path';
@ -129,6 +129,8 @@ for (const parentRepo of ModuleRepos) {
// resetDir(cloneDir);
// rmSync(cloneDir, { recursive: true, force: true });
if (existsSync(cloneDir)) rmSync(cloneDir, { recursive: true, force: true });
await new Promise((res) => exec(`git clone ${url} ${cloneDir}`, res));