[Base] Force rm clone dir if exists
This commit is contained in:
parent
32eebc02b3
commit
3487624ac0
|
@ -6,7 +6,7 @@ import Parcel from 'parcel-bundler';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import glob from 'glob';
|
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 { createHash } from 'crypto';
|
||||||
|
|
||||||
import { dirname } from 'path';
|
import { dirname } from 'path';
|
||||||
|
@ -130,6 +130,8 @@ for (const parentRepo of ModuleRepos) {
|
||||||
// resetDir(cloneDir);
|
// resetDir(cloneDir);
|
||||||
// rmSync(cloneDir, { recursive: true, force: true });
|
// 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));
|
await new Promise((res) => exec(`git clone ${url} ${cloneDir}`, res));
|
||||||
|
|
||||||
process.chdir(cloneDir);
|
process.chdir(cloneDir);
|
||||||
|
|
Loading…
Reference in New Issue