Skip to content

Commit fae07e1

Browse files
committed
use fs instead of touch for cross-platform (windows) compatibility; fix prettttier thing i missed
1 parent e188a39 commit fae07e1

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/deploy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ class Deployer {
279279
if (!isGit) throw new CliError("Not at root of a git repository.");
280280

281281
const {ownerName, repoName} = await getGitHubRemote();
282-
const a = (await promisify(exec)("git rev-parse --abbrev-ref HEAD"));
282+
const a = await promisify(exec)("git rev-parse --abbrev-ref HEAD");
283283
console.log("validateGitHubLink", {stdout: a.stdout, stderr: a.stderr});
284284
const branch = a.stdout.trim();
285285
let localRepo = await this.apiClient.getGitHubRepository({ownerName, repoName});

test/deploy-test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import assert, {fail} from "node:assert";
22
import {exec} from "node:child_process";
33
import type {Stats} from "node:fs";
4-
import {stat} from "node:fs/promises";
4+
import {open, stat} from "node:fs/promises";
55
import {Readable, Writable} from "node:stream";
66
import {promisify} from "node:util";
77
import type {BuildManifest} from "../src/build.js";
@@ -257,8 +257,11 @@ describe("deploy", () => {
257257
true // Do you want to enable continuous deployment?
258258
);
259259

260+
await (
261+
await open("readme.md", "a")
262+
).close;
260263
const {stdout, stderr} = await promisify(exec)(
261-
"touch readme.md && git add . && git commit -m 'initial' && git remote add origin [email protected]:observablehq/test.git"
264+
"git add . && git commit -m 'initial' && git remote add origin [email protected]:observablehq/test.git"
262265
);
263266
console.log("starts cloud build test", {stdout, stderr});
264267

0 commit comments

Comments
 (0)