forked from microsoft/vscode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-entrypoint.sh
More file actions
53 lines (45 loc) · 1.21 KB
/
docker-entrypoint.sh
File metadata and controls
53 lines (45 loc) · 1.21 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
49
50
51
52
53
#!/bin/bash
set -e
# Iniciar Xvfb en background
Xvfb :99 -screen 0 1024x768x16 &
XVFB_PID=$!
export DISPLAY=:99
sleep 2
# Cleanup function
cleanup() {
echo "Stopping Xvfb..."
kill $XVFB_PID 2>/dev/null || true
}
trap cleanup EXIT
# Si se instalaron dependencias npm, configurar wrapper de Inno Setup
if [ -d "node_modules/innosetup/bin" ] && [ -f "node_modules/innosetup/bin/ISCC.exe" ]; then
# Solo crear wrapper si no existe ya
if ! grep -q "wine" node_modules/innosetup/bin/ISCC.exe 2>/dev/null; then
echo "Configurando wrapper de Inno Setup..."
mv node_modules/innosetup/bin/ISCC.exe node_modules/innosetup/bin/ISCC-original.exe
cat > node_modules/innosetup/bin/ISCC.exe << 'EOF'
#!/bin/bash
export DISPLAY=:99
args=()
for arg in "$@"; do
# Convertir paths Unix a Windows, excepto flags que empiezan con /
if [[ "$arg" == /* ]] && [[ ! "$arg" =~ ^/[A-Z] ]]; then
winpath=$(winepath -w "$arg" 2>/dev/null)
if [ -n "$winpath" ]; then
args+=("$winpath")
else
args+=("$arg")
fi
else
args+=("$arg")
fi
done
cd "$(dirname "$0")"
wine ISCC-original.exe "${args[@]}"
EOF
chmod +x node_modules/innosetup/bin/ISCC.exe
echo "Wrapper de Inno Setup configurado"
fi
fi
# Ejecutar comando del usuario
exec "$@"