Skip to content

Commit

Permalink
Fix unterminated quoted string error when running podman v4
Browse files Browse the repository at this point in the history
Release candidates of podman v4 are unable to handle escape sequences inside strings.
See: containers/podman#13446
Work around this by using the println function instead.
  • Loading branch information
Sander Pikhoff authored and owtaylor committed Mar 9, 2022
1 parent 996df0a commit 43662e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ fi
# different toolboxes step on each other.

homevar="$(flatpak-spawn --host podman inspect "$container_name" \
--format='{{ range .Config.Env }}{{ . }}{{"\n"}}{{ end }}' \
--format='{{ range .Config.Env }}{{ println . }}{{ end }}' \
| grep ^HOME=)"
homevar="${homevar#HOME=}"

Expand Down
6 changes: 3 additions & 3 deletions tests/test-basic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ test_basic() {

assert_contents /logs/basic.cmd <<'EOF'
flatpak list --app --columns=application
podman inspect toolbox-vscode-test --format={{ range .Config.Env }}{{ . }}{{"\n"}}{{ end }}
podman inspect toolbox-vscode-test --format={{ range .Config.Env }}{{ println . }}{{ end }}
flatpak ps --columns=instance,application,pid
flatpak run com.visualstudio.code --remote attached-container+746f6f6c626f782d7673636f64652d74657374 /home/testuser/project
EOF
Expand Down Expand Up @@ -66,7 +66,7 @@ test_installation() {
flatpak list --app --columns=application
flatpak remotes --columns=name
flatpak install flathub com.visualstudio.code
podman inspect toolbox-vscode-test --format={{ range .Config.Env }}{{ . }}{{"\n"}}{{ end }}
podman inspect toolbox-vscode-test --format={{ range .Config.Env }}{{ println . }}{{ end }}
flatpak ps --columns=instance,application,pid
flatpak run com.visualstudio.code --remote attached-container+746f6f6c626f782d7673636f64652d74657374 /home/testuser/project
EOF
Expand Down Expand Up @@ -98,7 +98,7 @@ test_running() {

assert_contents /logs/running.cmd <<'EOF'
flatpak list --app --columns=application
podman inspect toolbox-vscode-test --format={{ range .Config.Env }}{{ . }}{{"\n"}}{{ end }}
podman inspect toolbox-vscode-test --format={{ range .Config.Env }}{{ println . }}{{ end }}
flatpak ps --columns=instance,application,pid
flatpak enter 123456 sh -c
cd $0
Expand Down

0 comments on commit 43662e7

Please sign in to comment.