Add auto-start script
This commit is contained in:
parent
e56badd200
commit
0263595806
1
.gitignore
vendored
1
.gitignore
vendored
@ -4,3 +4,4 @@ Cargo.lock
|
|||||||
**/*.rs.bk
|
**/*.rs.bk
|
||||||
.vscode/
|
.vscode/
|
||||||
Notes.md
|
Notes.md
|
||||||
|
openai.sk
|
||||||
|
19
start.sh
Executable file
19
start.sh
Executable file
@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/zsh
|
||||||
|
|
||||||
|
if ! [ -f "target/release/ai_chat" ]; then
|
||||||
|
if ! cargo build --release; then
|
||||||
|
echo "Could not build binary! Press any key to exit..." >&2
|
||||||
|
read
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! [ -f "openai.sk" ]; then
|
||||||
|
echo -n "Enter OpenAI secret key: "
|
||||||
|
read -s OPENAI_SK
|
||||||
|
else
|
||||||
|
OPENAI_SK="$(cat openai.sk)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
export OPENAI_SK
|
||||||
|
target/release/ai_chat
|
Loading…
x
Reference in New Issue
Block a user