Skip to content

Commit f1cd74d

Browse files
committed
setting name and email config for git, seeing if that helps
1 parent ff60b80 commit f1cd74d

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

src/deploy.ts

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

281281
const {ownerName, repoName} = await getGitHubRemote();
282-
const branch = (await promisify(exec)("git rev-parse --abbrev-ref HEAD")).stdout.trim();
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();
283285
let localRepo = await this.apiClient.getGitHubRepository({ownerName, repoName});
284286

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

test/deploy-test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ describe("deploy", () => {
260260
const {stdout, stderr} = await promisify(exec)(
261261
"touch readme.md; git add .; git commit -m 'initial'; git remote add origin [email protected]:observablehq/test.git"
262262
);
263-
console.log({stdout, stderr});
263+
console.log("starts cloud build test", {stdout, stderr});
264264

265265
await deploy(TEST_OPTIONS, effects);
266266

test/mocks/directory.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { exec } from "child_process";
2-
import { mkdtemp, rm } from "fs/promises";
3-
import { tmpdir } from "os";
4-
import { join } from "path/posix";
5-
import { promisify } from "util";
1+
import {exec} from "child_process";
2+
import {mkdtemp, rm} from "fs/promises";
3+
import {tmpdir} from "os";
4+
import {join} from "path/posix";
5+
import {promisify} from "util";
66

7-
export function mockIsolatedDirectory({ git }: { git: boolean; }) {
7+
export function mockIsolatedDirectory({git}: {git: boolean}) {
88
let dir: string;
99
let cwd: string;
1010
beforeEach(async () => {
@@ -13,15 +13,17 @@ export function mockIsolatedDirectory({ git }: { git: boolean; }) {
1313
process.chdir(dir);
1414
if (git) {
1515
console.log("logging stdout, stderr");
16-
const a = (await promisify(exec)("git config --global init.defaultBranch main"))
16+
const a = await promisify(exec)(
17+
"git config --global user.email \"[email protected]\"; git config --global user.name \"Your Name\"; git config --global init.defaultBranch main"
18+
);
1719
console.log(a.stdout, a.stderr);
18-
const b = (await promisify(exec)("git init"));
20+
const b = await promisify(exec)("git init");
1921
console.log(b.stdout, b.stderr);
20-
};
22+
}
2123
});
2224

2325
afterEach(async () => {
2426
process.chdir(cwd);
25-
await rm(dir, { recursive: true });
27+
await rm(dir, {recursive: true});
2628
});
2729
}

0 commit comments

Comments
 (0)