diff --git a/.deepwork/.gitignore b/.deepwork/.gitignore index e597ebbd..febee622 100644 --- a/.deepwork/.gitignore +++ b/.deepwork/.gitignore @@ -4,6 +4,6 @@ .last_head_ref job.schema.json -# Temporary files (but keep the directory via .gitkeep) +# Temporary files (tmp/.gitignore handles ignoring its own contents) tmp/* -!tmp/.gitkeep +!tmp/.gitignore diff --git a/.deepwork/tmp/.gitignore b/.deepwork/tmp/.gitignore new file mode 100644 index 00000000..0f950cee --- /dev/null +++ b/.deepwork/tmp/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# But keep this .gitignore +!.gitignore diff --git a/.deepwork/tmp/.gitkeep b/.deepwork/tmp/.gitkeep deleted file mode 100644 index 971fbd5c..00000000 --- a/.deepwork/tmp/.gitkeep +++ /dev/null @@ -1,3 +0,0 @@ -# This file ensures the .deepwork/tmp directory exists in version control. -# The tmp directory is used for temporary files during DeepWork operations. -# Do not delete this file. diff --git a/src/deepwork/cli/serve.py b/src/deepwork/cli/serve.py index bd4817c7..54b77916 100644 --- a/src/deepwork/cli/serve.py +++ b/src/deepwork/cli/serve.py @@ -118,6 +118,13 @@ def _serve_mcp( tmp_dir = project_path / ".deepwork" / "tmp" tmp_dir.mkdir(parents=True, exist_ok=True) + # Ensure .deepwork/tmp/.gitignore exists to keep tmp contents out of git + tmp_gitignore = tmp_dir / ".gitignore" + if not tmp_gitignore.exists(): + tmp_gitignore.write_text( + "# Ignore everything in this directory\n*\n# But keep this .gitignore\n!.gitignore\n" + ) + # Create and run server from deepwork.jobs.mcp.server import create_server