feat(ai-coder): open in typora or terminal based on -t flag

This commit is contained in:
Ayo Ayco 2025-08-25 16:40:01 +02:00
parent e7e16ac3e4
commit fe2d9514ce

View file

@ -37,16 +37,21 @@ if [[ -n "$other_args" ]]; then
fi fi
fi fi
if ! [ "$other_args" = "" ]; then if ! [ "$other_args" = "" ]; then
if [ "$other_args" = "sleep" ]; then if [ "$other_args" = "sleep" ]; then
ollama stop $model ollama stop $model
elif [ "$other_args" = "init" ]; then elif [ "$other_args" = "init" ]; then
ollama create "$model" -f "$modelfile" ollama create "$model" -f "$modelfile"
else else
tempfile="$(mktemp)" # If -t flag is set, use typora to display output
ollama run $model "$other_args" --hidethinking > $tempfile if [ "$typora_flag" = true ]; then
typora $tempfile tempfile="$(mktemp)"
ollama run $model "$other_args" --hidethinking > $tempfile
typora $tempfile
else
# If no -t flag, just run the command normally
ollama run $model "$other_args" --hidethinking
fi
fi fi
else else
ollama run $model --hidethinking ollama run $model --hidethinking