Conversation
Provides a .env sanity-check script that validates required variables for Polymarket Agents.
Adds a succinct guide for deploying the Polymarket agent, covering environment setup, dependency installation and running via Python or Docker.
| export "${key}=${value}" | ||
| ;; | ||
| esac | ||
| done < "${ENV_FILE}" |
There was a problem hiding this comment.
Quoted empty values incorrectly pass validation check
The .env.example template uses quoted empty values like POLYGON_WALLET_PRIVATE_KEY="". When parsing with IFS='=', the literal quote characters are preserved in the value. The -z check then incorrectly considers "" (two quote characters) as non-empty, so the sanity check passes for unfilled placeholder values. Users who copy the template without filling in real values would not be warned.
|
|
||
| missing=0 | ||
|
|
||
| while IFS='=' read -r key value; do |
There was a problem hiding this comment.
Last line silently ignored if file lacks newline
The while IFS='=' read -r key value loop doesn't process the last line of the .env file if it lacks a trailing newline. When read hits EOF without a newline, it returns non-zero even though it successfully read data, causing the loop to exit before processing that line. This could silently ignore a required variable like OPENAI_API_KEY if it happens to be on the final line, with no error message indicating why the check fails.
Adds a succinct guide for deploying the Polymarket agent, covering environment setup, dependency installation and running via Python or Docker.
Note
Introduces concise deployment documentation and a utility to validate environment configuration.
docs/DEPLOYMENT_GUIDE.mdwith steps to set env vars, install dependencies, runagents/main.py, and Docker build/run guidancescripts/bash/check_env.shto sanity-check.envpresence and required vars (POLYGON_WALLET_PRIVATE_KEY,OPENAI_API_KEY), exporting values and exiting non-zero if missingWritten by Cursor Bugbot for commit caf1d35. This will update automatically on new commits. Configure here.