@powerhousedao/ph-cli 5.1.0-dev.11 → 5.1.0-dev.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,6 +6,13 @@
6
6
  PROJECT_NAME=${1:-"global"}
7
7
  ACTION=${2:-"status"}
8
8
 
9
+ # Nginx config file name - remove leading dot to avoid hidden file issues
10
+ # (nginx's include directive with * glob doesn't match hidden files)
11
+ NGINX_CONFIG_NAME="${PROJECT_NAME#.}"
12
+ if [ "$NGINX_CONFIG_NAME" = "" ]; then
13
+ NGINX_CONFIG_NAME="default-ph"
14
+ fi
15
+
9
16
  # Get Switchboard port from .env or use default
10
17
  if [ -f ".env" ]; then
11
18
  SWITCHBOARD_PORT=$(grep "SWITCHBOARD_PORT=" .env | cut -d'=' -f2)
@@ -42,8 +49,8 @@ else
42
49
  fi
43
50
 
44
51
  # Check if Nginx configuration exists
45
- if [ ! -f "/etc/nginx/sites-available/$project_name" ]; then
46
- echo "Error: Nginx configuration not found"
52
+ if [ ! -f "/etc/nginx/sites-available/$NGINX_CONFIG_NAME" ]; then
53
+ echo "Error: Nginx configuration not found at /etc/nginx/sites-available/$NGINX_CONFIG_NAME"
47
54
  error=1
48
55
  fi
49
56
 
@@ -62,11 +69,11 @@ else
62
69
  # Function to enable/disable Nginx site
63
70
  manage_nginx_site() {
64
71
  local action=$1
65
- local site_path="/etc/nginx/sites-available/$PROJECT_NAME"
66
- local enabled_path="/etc/nginx/sites-enabled/$PROJECT_NAME"
67
-
72
+ local site_path="/etc/nginx/sites-available/$NGINX_CONFIG_NAME"
73
+ local enabled_path="/etc/nginx/sites-enabled/$NGINX_CONFIG_NAME"
74
+
68
75
  if [ ! -f "$site_path" ]; then
69
- echo "Error: Nginx site configuration for $PROJECT_NAME not found"
76
+ echo "Error: Nginx site configuration for $NGINX_CONFIG_NAME not found"
70
77
  return 1
71
78
  fi
72
79
 
@@ -94,7 +101,8 @@ else
94
101
  echo "Building Connect..."
95
102
  ph connect build
96
103
  sudo rm -rf /var/www/html/${PROJECT_NAME}
97
- sudo cp -r .ph/connect-build/dist /var/www/html/${PROJECT_NAME}
104
+ sudo mkdir -p /var/www/html/${PROJECT_NAME}
105
+ sudo cp -r .ph/connect-build/dist/* /var/www/html/${PROJECT_NAME}/
98
106
 
99
107
  # Enable Nginx site
100
108
  manage_nginx_site "enable"
@@ -152,7 +160,7 @@ else
152
160
  connect_health="❌"
153
161
  connect_memory="N/A"
154
162
  connect_uptime="N/A"
155
- if [ -L "/etc/nginx/sites-enabled/$PROJECT_NAME" ]; then
163
+ if [ -L "/etc/nginx/sites-enabled/$NGINX_CONFIG_NAME" ]; then
156
164
  connect_status="Enabled"
157
165
  # Check if Connect is reachable
158
166
  if curl -s -f "http://localhost/$PROJECT_NAME" > /dev/null; then
@@ -1,2 +1,2 @@
1
- export declare const version = "5.1.0-dev.10";
1
+ export declare const version = "5.1.0-dev.12";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1,3 +1,3 @@
1
1
  // This file is auto-generated. DO NOT EDIT.
2
- export const version = "5.1.0-dev.10";
2
+ export const version = "5.1.0-dev.12";
3
3
  //# sourceMappingURL=version.js.map