Skip to content

Commit

Permalink
fix(forge): add --json parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Rubilmax committed Dec 6, 2024
1 parent 7464528 commit 073eec3
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 19 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/check-dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,11 @@ jobs:
node-version: 22
cache: yarn

- name: Install dependencies
run: yarn install --frozen-lockfile
- run: yarn install --frozen-lockfile

- name: Rebuild the dist/ directory
run: yarn release
- run: yarn release

- name: Compare the expected and actual dist/ directories
run: |
- run: |
if [ "$(git diff --ignore-space-at-eol --text dist/ | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build. See status below:"
git diff
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,13 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install Foundry
uses: foundry-rs/[email protected]
- uses: foundry-rs/[email protected]

- uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn

- name: Install dependencies
run: yarn install --frozen-lockfile
- run: yarn install --frozen-lockfile

- name: Run tests
run: yarn test
- run: yarn test
6 changes: 2 additions & 4 deletions .github/workflows/foundry-storage-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install Foundry
uses: foundry-rs/[email protected]
- uses: foundry-rs/[email protected]

- name: Check storage layout
uses: Rubilmax/foundry-storage-check@main
- uses: Rubilmax/foundry-storage-check@main
with:
contract: contracts/Example.sol:Example
2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ const exactify = (variable) => ({
offset: BigInt(variable.offset),
});
const createLayout = (contract, cwd = ".") => {
return (0, child_process_1.execSync)(`forge inspect ${contract} storage-layout`, {
return (0, child_process_1.execSync)(`forge inspect ${contract} storage-layout --json`, {
encoding: "utf-8",
cwd,
});
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const exactify = (variable: StorageVariable): StorageVariableExact => ({
});

export const createLayout = (contract: string, cwd = ".") => {
return execSync(`forge inspect ${contract} storage-layout`, {
return execSync(`forge inspect ${contract} storage-layout --json`, {
encoding: "utf-8",
cwd,
});
Expand Down

0 comments on commit 073eec3

Please sign in to comment.