Skip to content

Commit

Permalink
changeset for initial commit changes (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
escottalexander authored Sep 30, 2024
2 parents 6cb26b3 + 49e7db4 commit 6e10c39
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/calm-eggs-bathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"eth-tech-tree": patch
---

intitial commit changes
10 changes: 4 additions & 6 deletions src/tasks/create-first-git-commit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,16 @@ const foundryLibraries = ["foundry-rs/forge-std", "OpenZeppelin/openzeppelin-con

export async function createFirstGitCommit(targetDir: string) {
try {
// Remove remote
await execa("git", ["remote", "remove", "origin"], { cwd: targetDir });
// Add and commit all changes
await execa("git", ["add", "-A"], { cwd: targetDir });
await execa("git", ["commit", "-m", "Initial commit with 🏗️ Scaffold-ETH 2", "--no-verify"], { cwd: targetDir });
const foundryWorkSpacePath = path.resolve(targetDir, "packages", "foundry");
// remove lib directory since it doesn't like directories to exist when installing
await execa("rm",["-rf", "lib"], { cwd: foundryWorkSpacePath });
// forge install foundry libraries
await execa("forge", ["install", ...foundryLibraries, "--no-commit"], { cwd: foundryWorkSpacePath });
// Add and commit all changes
await execa("git", ["add", "-A"], { cwd: targetDir });
await execa("git", ["commit", "--amend", "--no-edit"], { cwd: targetDir });
await execa("git", ["commit", "-m", "Initial commit with 🏗️ Scaffold-ETH 2", "--no-verify"], { cwd: targetDir });
// Remove remote
await execa("git", ["remote", "remove", "origin"], { cwd: targetDir });
} catch (e: any) {
// cast error as ExecaError to get stderr
throw new Error("Failed to initialize git repository", {
Expand Down

0 comments on commit 6e10c39

Please sign in to comment.