Closed redbeardymcgee closed 5 months ago
If I'm reading this line correctly from the log, it looks like you dropped the surrounding single quotes '
somewhere while trying to sanitize the input.
128 │ + eval /home/josh/.local/bin/distrobox-create --yes -v --name test --init-hooks ": │ ; sh -c "$(curl -fsLS get.chezmoi.io)" -- -b "$HOME/.local/bin""
Here I see that perhaps the culprit is somewhere here, as the outer quotes are lost now.
58 │ + echo init_hooks='sh -c "$(curl -fsLS get.chezmoi.io)" -- -b "$HOME/.local/bin"'
59 │ + run_distrobox test
60 │ + name=test
61 │ + [ != ]
62 │ + [ -e /tmp/tmp.Enf9OKt7OV ]
63 │ + . /tmp/tmp.Enf9OKt7OV
64 │ + init_hooks=sh -c "$(curl -fsLS get.chezmoi.io)" -- -b "$HOME/.local/bin"
Here is the result of trying to embed and escape more quotes, like so:
init_hooks='"sh -c \"$(curl -fsLS get.chezmoi.io)\" -- -b \"$HOME/.local/bin\""'
Error: error inspecting object: no such container "#!/bin/sh
# chezmoi install script
... it's the whole install script
You need to also escape the dollarsign, as it will be evaluated by your current shell, not inside the container
so:
init_hooks='sh -c \"\$(curl -fsLS get.chezmoi.io)\"'
If you don't escape the $(
this will be evaluated by your current shell BEFORE going to distrobox
this is valid for every script and shell command, not a distrobox exclusive
This works indeed
Describe the bug Uhm...
To Reproduce
test.ini
distrobox assemble create --replace --file ./test.ini
Expected behavior Build the container, with
chezmoi
bootstrapped into$HOME/.local/bin
Host system podman 3.4.4 distrobox 1.7.2 Pop!OS 22.04
curl -s https://raw.githubusercontent.com/89luca89/distrobox/main/install | sh -s -- --next --prefix ~/.local
Additional context test.log