diff --git a/.yolo-safety-off b/.yolo-safety-off new file mode 100644 index 0000000..e69de29 diff --git a/install.bat b/install.bat new file mode 100644 index 0000000..23145e6 --- /dev/null +++ b/install.bat @@ -0,0 +1,20 @@ +@echo off +:: Installs yolo in the user's home directory + +::TARGET_DIR=~/yolo-ai-cmdbot +::TARGET_FULLPATH=$TARGET_DIR/yolo.py +set TARGET_DIR= %HOME%yolo-ai-cmdbot +set TARGET_FULLPATH= %TARGET_DIR%\yolo.py + +::mkdir -p $TARGET_DIR +::cp yolo.py prompt.txt $TARGET_DIR +::chmod +x $TARGET_FULLPATH +mkdir %TARGET_DIR% +copy yolo.py %TARGET_DIR% +copy prompt.txt %TARGET_DIR% + +:: Windows: Copies .bat file to $HOME so it works similar to LINUX/MAC, avoiding having to type python.exe every time. +:: Note: Though that maybe making it an executable would make more sense but the + +::Copy to home directory +copy yolo.bat %HOME% \ No newline at end of file diff --git a/install.sh b/install.sh index f46023e..a019293 100644 --- a/install.sh +++ b/install.sh @@ -16,7 +16,3 @@ alias computer=$TARGET_FULLPATH # Add the aliases to the logon scripts echo "alias yolo=$TARGET_FULLPATH" >> ~/.bash_aliases echo "alias computer=$TARGET_FULLPATH" >> ~/.bash_aliases - -# Windows -# Copy yolo.bat to System32 or Home Directory : -cp yolo.bat ~ diff --git a/yolo.bat b/yolo.bat index b958c12..d2cf92f 100644 --- a/yolo.bat +++ b/yolo.bat @@ -1,6 +1,6 @@ @echo off REM Work around to not have to type in python.exe yolo.py every time. -REM Put in C:/Windows/System32 to allow command to work anywhere +REM Put in C:/Windows/System32 or another $PATH directory to allow command to work anywhere python.exe yolo-ai-cmdbot/yolo.py %* \ No newline at end of file diff --git a/yolo.py b/yolo.py index 78e1775..360ae25 100755 --- a/yolo.py +++ b/yolo.py @@ -82,10 +82,11 @@ if __name__ == "__main__": # Two options for the user to specify they openai api key. Windows: Comment out the one you are not using (Causes extra line to appear) - home_path = os.path.expanduser("~") - openai.api_key_path = os.path.join(home_path,".openai.apikey") dotenv.load_dotenv() openai.api_key = os.getenv("OPENAI_API_KEY") + if not openai.api_key: + home_path = os.path.expanduser("~") + openai.api_key_path = os.path.join(home_path,".openai.apikey") # Parse arguments and make sure we have at least a single word if len(sys.argv) < 2: