Skip to content

Commit

Permalink
fix(sync): don't rm tmp path when run again, ref #32
Browse files Browse the repository at this point in the history
  • Loading branch information
sorrycc committed Nov 13, 2024
1 parent 1f75217 commit c647963
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/sync/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ export interface SyncOptions extends BaseOptions {
export async function sync(opts: SyncOptions) {
const { tmpPath } = opts;

fs.rmSync(tmpPath, { recursive: true, force: true });
fs.mkdirSync(tmpPath, { recursive: true });
if (!opts.runAgain) {
fs.rmSync(tmpPath, { recursive: true, force: true });
fs.mkdirSync(tmpPath, { recursive: true });
}

await writeRouteTree(opts);
const globalStyleImportPath = writeGlobalStyle(opts);
Expand Down

0 comments on commit c647963

Please sign in to comment.