From 069810f215f5be1273385f5db810e4f89f4a689c Mon Sep 17 00:00:00 2001 From: Ricardo Guilherme Schmidt <3esmit@gmail.com> Date: Sat, 24 Feb 2024 13:27:48 -0300 Subject: [PATCH] chore: try to separate gas-report script into .sh --- gas-report.sh | 2 ++ package.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100755 gas-report.sh diff --git a/gas-report.sh b/gas-report.sh new file mode 100755 index 0000000..ae3d09a --- /dev/null +++ b/gas-report.sh @@ -0,0 +1,2 @@ +#!/bin/bash +forge test --gas-report 2>&1 | (tee /dev/tty | awk '/Test result:/ {found=1; buffer=""; next} found && !/Ran/ {buffer=buffer $0 ORS} /Ran/ {found=0} END {printf "%s", buffer}' > .gas-report) \ No newline at end of file diff --git a/package.json b/package.json index 6ba47b1..8ad4e99 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,6 @@ "lint:sol": "forge fmt --check && pnpm solhint {script,src,test,certora}/**/*.sol", "prettier:check": "prettier --check **/*.{json,md,yml} --ignore-path=.prettierignore", "prettier:write": "prettier --write **/*.{json,md,yml} --ignore-path=.prettierignore", - "gas:report": "forge test --gas-report 2>&1 | (tee /dev/tty | awk '/Test result:/ {found=1; buffer=\"\"; next} found && !/Ran/ {buffer=buffer $0 ORS} /Ran/ {found=0} END {printf \"%s\", buffer}' > .gas-report)" + "gas:report": "./gas-report.sh" } } \ No newline at end of file