|
|
@@ -3,9 +3,23 @@
|
|
|
# Script to handle issue automation with Claude Code
|
|
|
# This script is called when an issue is opened or commented on
|
|
|
|
|
|
+# Ensure HOME is set (systemd might not set it)
|
|
|
+if [ -z "$HOME" ]; then
|
|
|
+ export HOME=$(getent passwd "$(whoami)" | cut -d: -f6)
|
|
|
+fi
|
|
|
+
|
|
|
# Add claude binary to PATH
|
|
|
export PATH="$HOME/.local/bin:$PATH"
|
|
|
|
|
|
+# Ensure Claude Code has writable directories for cache and config
|
|
|
+export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}"
|
|
|
+export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
|
|
|
+export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
|
|
|
+export XDG_STATE_HOME="${XDG_STATE_HOME:-$HOME/.local/state}"
|
|
|
+
|
|
|
+# Create these directories if they don't exist
|
|
|
+mkdir -p "$XDG_CACHE_HOME" "$XDG_CONFIG_HOME" "$XDG_DATA_HOME" "$XDG_STATE_HOME"
|
|
|
+
|
|
|
# Parse arguments
|
|
|
OWNER="$1"
|
|
|
REPO="$2"
|
|
|
@@ -49,7 +63,10 @@ else
|
|
|
# Pull latest changes
|
|
|
cd "$REPO_PATH" || exit 1
|
|
|
echo "Pulling latest changes..."
|
|
|
- git pull
|
|
|
+ # Try to pull, but don't fail if it errors (might be file system issues)
|
|
|
+ if ! git pull 2>&1; then
|
|
|
+ echo "Warning: git pull failed, continuing with existing repository state"
|
|
|
+ fi
|
|
|
fi
|
|
|
|
|
|
# Change to repo directory
|