fix: rebuild errors on windows (#692)
This commit is contained in:
		@@ -5,7 +5,6 @@ import chalk from "chalk"
 | 
			
		||||
import { sassPlugin } from "esbuild-sass-plugin"
 | 
			
		||||
import fs from "fs"
 | 
			
		||||
import { intro, outro, select, text } from "@clack/prompts"
 | 
			
		||||
import { rimraf } from "rimraf"
 | 
			
		||||
import chokidar from "chokidar"
 | 
			
		||||
import prettyBytes from "pretty-bytes"
 | 
			
		||||
import { execSync, spawnSync } from "child_process"
 | 
			
		||||
@@ -21,6 +20,7 @@ import {
 | 
			
		||||
  gitPull,
 | 
			
		||||
  popContentFolder,
 | 
			
		||||
  stashContentFolder,
 | 
			
		||||
  rmrf,
 | 
			
		||||
} from "./helpers.js"
 | 
			
		||||
import {
 | 
			
		||||
  UPSTREAM_NAME,
 | 
			
		||||
@@ -109,7 +109,7 @@ export async function handleCreate(argv) {
 | 
			
		||||
    if (contentStat.isSymbolicLink()) {
 | 
			
		||||
      await fs.promises.unlink(contentFolder)
 | 
			
		||||
    } else {
 | 
			
		||||
      await rimraf(contentFolder)
 | 
			
		||||
      await rmrf(contentFolder)
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -3,6 +3,7 @@ import chalk from "chalk"
 | 
			
		||||
import { contentCacheFolder } from "./constants.js"
 | 
			
		||||
import { spawnSync } from "child_process"
 | 
			
		||||
import fs from "fs"
 | 
			
		||||
import { rimraf } from "rimraf"
 | 
			
		||||
 | 
			
		||||
export function escapePath(fp) {
 | 
			
		||||
  return fp
 | 
			
		||||
@@ -52,3 +53,11 @@ export async function popContentFolder(contentFolder) {
 | 
			
		||||
  })
 | 
			
		||||
  await fs.promises.rm(contentCacheFolder, { force: true, recursive: true })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export async function rmrf(path) {
 | 
			
		||||
  if (os.platform() == "win32") {
 | 
			
		||||
    return rimraf.windows(path)
 | 
			
		||||
  } else {
 | 
			
		||||
    return rimraf(path)
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user