Skip to content

Commit

Permalink
setting name and email config for git, seeing if that helps
Browse files Browse the repository at this point in the history
  • Loading branch information
tophtucker committed Nov 2, 2024
1 parent ff60b80 commit f1cd74d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
4 changes: 3 additions & 1 deletion src/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,9 @@ class Deployer {
if (!isGit) throw new CliError("Not at root of a git repository.");

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

// If a source repository has already been configured, check that it’s
Expand Down
2 changes: 1 addition & 1 deletion test/deploy-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ describe("deploy", () => {
const {stdout, stderr} = await promisify(exec)(
"touch readme.md; git add .; git commit -m 'initial'; git remote add origin [email protected]:observablehq/test.git"
);
console.log({stdout, stderr});
console.log("starts cloud build test", {stdout, stderr});

await deploy(TEST_OPTIONS, effects);

Expand Down
22 changes: 12 additions & 10 deletions test/mocks/directory.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { exec } from "child_process";
import { mkdtemp, rm } from "fs/promises";
import { tmpdir } from "os";
import { join } from "path/posix";
import { promisify } from "util";
import {exec} from "child_process";
import {mkdtemp, rm} from "fs/promises";
import {tmpdir} from "os";
import {join} from "path/posix";
import {promisify} from "util";

export function mockIsolatedDirectory({ git }: { git: boolean; }) {
export function mockIsolatedDirectory({git}: {git: boolean}) {
let dir: string;
let cwd: string;
beforeEach(async () => {
Expand All @@ -13,15 +13,17 @@ export function mockIsolatedDirectory({ git }: { git: boolean; }) {
process.chdir(dir);
if (git) {
console.log("logging stdout, stderr");
const a = (await promisify(exec)("git config --global init.defaultBranch main"))
const a = await promisify(exec)(
"git config --global user.email \"[email protected]\"; git config --global user.name \"Your Name\"; git config --global init.defaultBranch main"
);
console.log(a.stdout, a.stderr);
const b = (await promisify(exec)("git init"));
const b = await promisify(exec)("git init");
console.log(b.stdout, b.stderr);
};
}
});

afterEach(async () => {
process.chdir(cwd);
await rm(dir, { recursive: true });
await rm(dir, {recursive: true});
});
}

0 comments on commit f1cd74d

Please sign in to comment.