Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "fix: rebuild errors on windows (#692)" #695

Merged
merged 1 commit into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions quartz/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import sourceMapSupport from "source-map-support"
sourceMapSupport.install(options)
import path from "path"
import { PerfTimer } from "./util/perf"
import { rimraf } from "rimraf"
import { isGitIgnored } from "globby"
import chalk from "chalk"
import { parseMarkdown } from "./processors/parse"
Expand All @@ -12,7 +13,6 @@ import { FilePath, joinSegments, slugifyFilePath } from "./util/path"
import chokidar from "chokidar"
import { ProcessedContent } from "./plugins/vfile"
import { Argv, BuildCtx } from "./util/ctx"
import { rmrf } from "./util/fs"
import { glob, toPosixPath } from "./util/glob"
import { trace } from "./util/trace"
import { options } from "./util/sourcemap"
Expand Down Expand Up @@ -40,7 +40,7 @@ async function buildQuartz(argv: Argv, mut: Mutex, clientRefresh: () => void) {

const release = await mut.acquire()
perf.addEvent("clean")
await rmrf(output)
await rimraf(output)
console.log(`Cleaned output directory \`${output}\` in ${perf.timeSince("clean")}`)

perf.addEvent("glob")
Expand Down Expand Up @@ -145,7 +145,7 @@ async function startServing(

// TODO: we can probably traverse the link graph to figure out what's safe to delete here
// instead of just deleting everything
await rmrf(argv.output)
await rimraf(argv.output)
await emitContent(ctx, filteredContent)
console.log(chalk.green(`Done rebuilding in ${perf.timeSince()}`))
} catch (err) {
Expand Down
4 changes: 2 additions & 2 deletions quartz/cli/handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ 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"
Expand All @@ -20,7 +21,6 @@ import {
gitPull,
popContentFolder,
stashContentFolder,
rmrf,
} from "./helpers.js"
import {
UPSTREAM_NAME,
Expand Down Expand Up @@ -109,7 +109,7 @@ export async function handleCreate(argv) {
if (contentStat.isSymbolicLink()) {
await fs.promises.unlink(contentFolder)
} else {
await rmrf(contentFolder)
await rimraf(contentFolder)
}
}

Expand Down
9 changes: 0 additions & 9 deletions quartz/cli/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ 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
Expand Down Expand Up @@ -53,11 +52,3 @@ 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)
}
}
13 changes: 0 additions & 13 deletions quartz/util/fs.ts

This file was deleted.

Loading