Skip to content

Agent Zero AI framework

dotenv fix, gitignore update

frdelba3422d45228
diff --git a/.gitignore b/.gitignore
index 5a668772b..ccde9bfb0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,68 +1,45 @@
+# Ignore common unwanted files globally
**/.DS_Store
**/.env
**/__pycache__/
**/.conda/
-# Ignore git (for bundler)
+# Ignore git internal files (for bundler)
.git/
# Ignore all contents of the virtual environment directory
.venv/
-# ignore all folders under /bundle
+# Handle bundle directory
bundle/*/
-# except some
!bundle/mac_pkg_scripts
-# Ignore all contents of the directory "work_dir"
+# Handle work_dir directory
work_dir/*
-# But do not ignore the directory itself
-!work_dir/.gitkeep
-# Ignore all contents of the directory "memory"
-memory/*
-# But do not ignore the directory itself
-!memory/.gitkeep
+# Handle memory directory
+memory/**
+!memory/**/
-# Ignore all contents of the directory "logs"
+# Handle logs directory
logs/*
-# But do not ignore the directory itself
-!logs/.gitkeep
-# Ignore all contents of the directory "tmp"
+# Handle tmp directory
tmp/*
-# But do not ignore the directory itself
-!tmp/.gitkeep
-# Ignore everything in the "knowledge" directory
-knowledge/*
-
-# Do not ignore subdirectories (so we can track .gitkeep)
-!knowledge/*/
-
-# Ignore all files within subdirectories (except .gitkeep)
-knowledge/**/*.*
-!knowledge/**/.gitkeep
-
-# Explicitly allow the default folder and its contents
+# Handle knowledge directory
+knowledge/**
+!knowledge/**/
+# Explicitly allow the default folder in knowledge
!knowledge/default/
!knowledge/default/**
-# Ignore everything in the "instruments" directory
-instruments/*
-
-# Do not ignore subdirectories (so we can track .gitkeep)
-!instruments/*/
-
-# Ignore all files within subdirectories (except .gitkeep)
-instruments/**/*.*
-!instruments/**/.gitkeep
-
-# Explicitly allow the default folder and its contents
+# Handle instruments directory
+instruments/**
+!instruments/**/
+# Explicitly allow the default folder in instruments
!instruments/default/
!instruments/default/**
-# Ignore all contents of the directory "bin"
-bin/*
-# But do not ignore the directory itself
-!bin/.gitkeep
+# Global rule to include .gitkeep files anywhere
+!**/.gitkeep
\ No newline at end of file
diff --git a/bin/.gitkeep b/memory/default/.gitkeep
similarity index 100%
rename from bin/.gitkeep
rename to memory/default/.gitkeep
diff --git a/python/helpers/cloudflare_tunnel.py b/python/helpers/cloudflare_tunnel.py
index 25f3b6176..eb90555bb 100644
--- a/python/helpers/cloudflare_tunnel.py
+++ b/python/helpers/cloudflare_tunnel.py
@@ -8,7 +8,7 @@ from python.helpers import files
class CloudflareTunnel:
def __init__(self, port: int):
self.port = port
- self.bin_dir = "bin" # Relative path
+ self.bin_dir = "tmp" # Relative path
self.cloudflared_path = None
self.tunnel_process = None
self.tunnel_url = None
diff --git a/python/helpers/dotenv.py b/python/helpers/dotenv.py
index 9b43ae28f..4557e0024 100644
--- a/python/helpers/dotenv.py
+++ b/python/helpers/dotenv.py
@@ -27,13 +27,10 @@ def save_dotenv_value(key: str, value: str):
found = False
for i, line in enumerate(lines):
if re.match(rf"^\s*{key}\s*=", line):
- if value == "":
- del lines[i]
- else:
- lines[i] = f"{key}={value}\n"
+ lines[i] = f"{key}={value}\n"
found = True
- if not found and value != "":
- lines.append(f"\n{key}={value}")
+ if not found:
+ lines.append(f"\n{key}={value}\n")
f.seek(0)
f.writelines(lines)
f.truncate()