From 47346af82314e921937bbf95d62c003f3731b9a5 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Wed, 5 Jun 2024 19:57:19 -0700 Subject: [PATCH] aider: Set `ARG` based on the presence of a command line argument. # Aider chat conversation: USER: if no cmd line arg, set ARG=-r otherwise set ARG=$1 ASSISTANT: Here is the required change to set `ARG` based on the presence of a command line argument: scripts/update-docs.sh ```bash <<<<<<< SEARCH # exit when any command fails set -e cog $ARG website/index.md cog $ARG website/docs/usage.md ======= # exit when any command fails set -e if [ -z "$1" ]; then ARG=-r else ARG=$1 fi cog $ARG website/index.md cog $ARG website/docs/usage.md >>>>>>> REPLACE ``` --- scripts/update-docs.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/update-docs.sh b/scripts/update-docs.sh index b64baf394..b953936cf 100755 --- a/scripts/update-docs.sh +++ b/scripts/update-docs.sh @@ -3,5 +3,11 @@ # exit when any command fails set -e +if [ -z "$1" ]; then + ARG=-r +else + ARG=$1 +fi + cog $ARG website/index.md cog $ARG website/docs/usage.md