Open kernelwhisperer opened 6 months ago
i actually use a lua linter for that in my build script
/opt/homebrew/bin/luacheck process.lua schemas.lua sqlschema.lua intervals.lua candles.lua stats.lua validation.lua indicators.lua
/opt/homebrew/bin/amalg.lua -s process.lua -o build/output.lua sqlschema intervals schemas validation candles stats indicators
npx aoform apply
Me too: https://github.com/Autonomous-Finance/dexscreener/blob/feat/agents/ao/build.sh
#!/bin/bash
if [[ "$(uname)" == "Linux" ]]; then
BIN_PATH="$HOME/.luarocks/bin"
else
BIN_PATH="/opt/homebrew/bin"
fi
# Navigate to src directory
cd "$(dirname "$0")/src"
# Run lint
$BIN_PATH/luacheck process.lua validation-schemas.lua db-utils.lua
# Run build
$BIN_PATH/amalg.lua -s process.lua -o ../build/output.lua db-utils validation-schemas validation
I had to update it to work on linux, but it's almost the same.
The issue I had was:
src
amalg.lua -s src/process.lua -o build/output.lua src/db-utils src/validation-schemas src/validation
This built it successfully, but failed when doing .load output.lua
This is why the script changes directory to src
now.
Sometimes I still use
aos
and.load contract.lua
to deploy because if there is a compile time error, it prints to the console.Would be nice if aoform did the same.
@smowden thoughts?