Skip to content

Commit 159d708

Browse files
author
Observable User
committed
WHEW i think everything should be passing now, removing debug console log junk
1 parent 87f707d commit 159d708

File tree

3 files changed

+11
-17
lines changed

3 files changed

+11
-17
lines changed

src/deploy.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,9 +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");
283-
console.log("validateGitHubLink", {stdout: a.stdout, stderr: a.stderr});
284-
const branch = a.stdout.trim();
282+
const branch = (await promisify(exec)("git rev-parse --abbrev-ref HEAD")).stdout.trim();
285283
let localRepo = await this.apiClient.getGitHubRepository({ownerName, repoName});
286284

287285
// If a source repository has already been configured, check that it’s

test/deploy-test.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,11 @@ describe("deploy", () => {
260260
await deploy(TEST_OPTIONS, effects);
261261
assert.fail("expected error");
262262
} catch (error) {
263-
CliError.assert(error, {message: `Configured repository does not match local repository; check build settings on ${link(`https://observablehq.com/projects/@${DEPLOY_CONFIG.workspaceLogin}/${DEPLOY_CONFIG.projectSlug}/settings`)}`});
263+
CliError.assert(error, {
264+
message: `Configured repository does not match local repository; check build settings on ${link(
265+
`https://observablehq.com/projects/@${DEPLOY_CONFIG.workspaceLogin}/${DEPLOY_CONFIG.projectSlug}/settings`
266+
)}`
267+
});
264268
}
265269

266270
effects.close();
@@ -290,10 +294,9 @@ describe("deploy", () => {
290294
);
291295

292296
await (await open("readme.md", "a")).close();
293-
const {stdout, stderr} = await promisify(exec)(
297+
await promisify(exec)(
294298
"git add . && git commit -m 'initial' && git remote add origin [email protected]:observablehq/test.git"
295299
);
296-
console.log("starts cloud build test", {stdout, stderr});
297300

298301
await deploy(TEST_OPTIONS, effects);
299302

@@ -325,10 +328,9 @@ describe("deploy", () => {
325328
);
326329

327330
await (await open("readme.md", "a")).close();
328-
const {stdout, stderr} = await promisify(exec)(
331+
await promisify(exec)(
329332
"git add . && git commit -m 'initial' && git remote add origin [email protected]:observablehq/test.git"
330333
);
331-
console.log("starts cloud build test", {stdout, stderr});
332334

333335
await deploy(TEST_OPTIONS, effects);
334336

test/mocks/directory.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {mkdtemp, rm} from "fs/promises";
33
import {tmpdir} from "os";
44
import {join} from "path/posix";
55
import {promisify} from "util";
6-
// import {rimraf} from "rimraf";
76

87
export function mockIsolatedDirectory({git}: {git: boolean}) {
98
let dir: string;
@@ -13,19 +12,14 @@ export function mockIsolatedDirectory({git}: {git: boolean}) {
1312
dir = await mkdtemp(join(tmpdir(), "framework-test-"));
1413
process.chdir(dir);
1514
if (git) {
16-
console.log("logging stdout, stderr");
17-
const a = await promisify(exec)(
18-
'git config --global user.email "[email protected]" && git config --global user.name "Observable User" && git config --global init.defaultBranch main'
15+
await promisify(exec)(
16+
'git config --global user.email "[email protected]" && git config --global user.name "Observable User" && git config --global init.defaultBranch main && git init'
1917
);
20-
console.log(a.stdout, a.stderr);
21-
const b = await promisify(exec)("git init");
22-
console.log(b.stdout, b.stderr);
2318
}
2419
});
2520

2621
afterEach(async () => {
2722
process.chdir(cwd);
28-
// await rimraf(dir);
29-
await rm(dir, {recursive: true}); //, force: true
23+
await rm(dir, {recursive: true});
3024
});
3125
}

0 commit comments

Comments
 (0)