-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·49 lines (42 loc) · 1.09 KB
/
Copy pathstart.sh
File metadata and controls
executable file
·49 lines (42 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
# Find and run the dist/main.js file
# This script handles different working directory scenarios on Render
echo "Starting application..."
echo "Current directory: $(pwd)"
# Try current directory first
if [ -f "dist/main.js" ]; then
echo "Found dist/main.js in current directory"
node dist/main.js
exit $?
fi
# Try parent directory (if we're in src/)
if [ -f "../dist/main.js" ]; then
echo "Found dist/main.js in parent directory"
cd .. && node dist/main.js
exit $?
fi
# Try dist/src/main.js (some build configurations)
if [ -f "dist/src/main.js" ]; then
echo "Found dist/src/main.js in current directory"
node dist/src/main.js
exit $?
fi
# Try ../dist/src/main.js
if [ -f "../dist/src/main.js" ]; then
echo "Found dist/src/main.js in parent directory"
cd .. && node dist/src/main.js
exit $?
fi
echo "Error: Could not find dist/main.js or dist/src/main.js"
echo "Current directory: $(pwd)"
echo "Directory contents:"
ls -la
if [ -d ".." ]; then
echo "Parent directory contents:"
ls -la ..
fi
if [ -d "dist" ]; then
echo "Dist directory contents:"
ls -la dist/
fi
exit 1