Support tilde expansion (e.g. ~/config), check ~/config and /root/config, and stage companion compose files

This commit is contained in:
jschantli committed 2026-09-04 20:38:23 -07:00
1 parent 5c44884c5c
commit 877ff62105
2 files changed
+14 -4

No files matched your search

+3 -2
View File
@@ -31,11 +31,12 @@ async def get_pangolin_stack_status() -> Dict[str, Any]:
# Query Remote VPS for files, DB, and Docker status
check_script = f"""
P_DIR="{p_dir}"
eval P_DIR="{p_dir}"
P_DIR="${{P_DIR/#~/$HOME}}"
if [ ! -d "$P_DIR" ] || [ -z "$(ls -A "$P_DIR" 2>/dev/null)" ]; then
DETECTED=$(docker inspect --format '{{{{index .Config.Labels \"com.docker.compose.project.working_dir\"}}}}' $(docker ps -aq --filter "name=pangolin" 2>/dev/null) 2>/dev/null | head -n 1)
if [ -z "$DETECTED" ] || [ ! -d "$DETECTED" ]; then
for candidate in /root/pangolin /opt/pangolin /home/*/pangolin /var/lib/pangolin /srv/pangolin /etc/pangolin; do
for candidate in "$HOME/config" "/root/config" "$HOME/pangolin" "/root/pangolin" "$HOME" "/opt/pangolin" /home/*/pangolin /var/lib/pangolin /srv/pangolin /etc/pangolin; do
if [ -d "$candidate" ] && [ -n "$(ls -A "$candidate" 2>/dev/null)" ]; then
DETECTED="$candidate"
break