Skip to content

Commit

Permalink
fix: Correct file output handling in bmai function
Browse files Browse the repository at this point in the history
  • Loading branch information
mbailey committed Jan 13, 2025
1 parent d6bd071 commit 9b4ed00
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions contrib/ai/bmai
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@ bmai() {
# and truncating to 50 chars
local filename=$(echo "$*" | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | cut -c1-50)

local ai_slop_bucket="${BMA_HOME:-$HOME/.bash-my-aws}/contrib/ai/slop"
mkdir -p "${ai_slop_bucket}"
local ai_slop_dir="${BMA_HOME:-$HOME/.bash-my-aws}/contrib/ai/slop"
mkdir -p "${ai_slop_dir}"
local output_file="${ai_slop_dir}/${filename}"

llm prompt \
-s "$(<"${conventions}")" \
"Do not provide a preamble or closing comments. Output only an authentic bash-my-aws command that follows the conventions and does the following: '$@'" \
| tee "${ai_slop_bucket}"
| tee "${output_file}"
}

# Execute function with same name as file called unless sourced
Expand Down

0 comments on commit 9b4ed00

Please sign in to comment.