Skip to content

Commit 651fb0e

Browse files
committed
update script
1 parent 129c91d commit 651fb0e

3 files changed

Lines changed: 26 additions & 5 deletions

File tree

src/desktop-lite/install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,9 +409,9 @@ else
409409
fi
410410
411411
# Run whatever was passed in
412-
if [ -n "$1" ]; then
412+
if [ -n "\$1" ]; then
413413
log "Executing \"\$@\"."
414-
exec "$@"
414+
exec "\$@"
415415
else
416416
log "No command provided to execute."
417417
fi

test/desktop-lite/scenarios.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,12 @@
1212
"noVncVersion": "1.2.0"
1313
}
1414
}
15-
},
15+
},
1616
"test_vnc_resolution_as_container_env_var": {
1717
"image": "ubuntu:noble",
1818
"features": {
1919
"desktop-lite": {}
20-
}
21-
,
20+
},
2221
"containerEnv": {
2322
"VNC_RESOLUTION": "1920x1080x32"
2423
},
@@ -45,5 +44,11 @@
4544
"features": {
4645
"desktop-lite": {}
4746
}
47+
},
48+
"test_desktop_init_exec_passthrough": {
49+
"image": "ubuntu:noble",
50+
"features": {
51+
"desktop-lite": {}
52+
}
4853
}
4954
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Optional: Import test library
6+
source dev-container-features-test-lib
7+
8+
# Verify that desktop-init.sh correctly passes through commands.
9+
# Previously, the heredoc in install.sh did not escape $1 and $@, causing them to expand
10+
# to empty strings at install time, so any command passed to desktop-init.sh was silently ignored.
11+
12+
check "command is passed through and executed" \
13+
bash -c "result=\$(/usr/local/share/desktop-init.sh echo 'passthrough-test-token' 2>/dev/null) && echo \"\$result\" | grep -q 'passthrough-test-token'"
14+
15+
# Report result
16+
reportResults

0 commit comments

Comments
 (0)