aboutsummaryrefslogtreecommitdiffhomepage
path: root/bin/gpt
diff options
context:
space:
mode:
authorHsieh Chin Fan <pham@topo.tw>2023-08-12 14:14:23 +0800
committerHsieh Chin Fan <pham@topo.tw>2023-08-12 14:14:30 +0800
commita7fdb4f49714d8526a68c1a0cd2549ca5e92eb6f (patch)
tree6de20022ecee7315eae53168b895b5768f27a34c /bin/gpt
parent88324114e3725415a550d233a0b9fc16d1d82e53 (diff)
Update for new laptop installation
Diffstat (limited to 'bin/gpt')
-rwxr-xr-xbin/gpt/gpt1
1 files changed, 1 insertions, 0 deletions
diff --git a/bin/gpt/gpt b/bin/gpt/gpt
index b348a2e..7dc55dd 100755
--- a/bin/gpt/gpt
+++ b/bin/gpt/gpt
@@ -224,6 +224,7 @@ _get_input_by_fzf() {
224 224
225# Check OPENAI API KEY in env 225# Check OPENAI API KEY in env
226# Exit with 6 (configuration issue) if it is not set 226# Exit with 6 (configuration issue) if it is not set
227XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-~/.config}
227[ -z "$OPENAI_API_KEY" ] && OPENAI_API_KEY=$(cat "$XDG_CONFIG_HOME"/openai/key) 228[ -z "$OPENAI_API_KEY" ] && OPENAI_API_KEY=$(cat "$XDG_CONFIG_HOME"/openai/key)
228[ -z "$OPENAI_API_KEY" ] && { echo API KEY not specified; exit 6; } 229[ -z "$OPENAI_API_KEY" ] && { echo API KEY not specified; exit 6; }
229 230