The current implementation uses dotenv to load the configuration into
the environment, and then delegate the cli layer to handle the
configuration coming from the DBX_ variables.
With this new implementation, defaults, config files and environment
variables are handled in a single point and treated as values.
* fix(containermanager): fix typos in ContanerID and ContanerManagerType
* fix(rm): pass ContainerHome to RmOptions when removing container
* fix(containermanager): handle empty names slice in podman container list
* fix(create): initialize prompter in NewCreateCommand to prevent nil dereference
* fix(userenv): trim trailing newline from uid and gid command output
* refactor(containermanager): move shared types and constants to providers common file
* fix(containermanager): skip /dev/shm volume mount if EvalSymlinks fails
* fix(containermanager): rename ContainerManagerType to ManagerType to avoid stutter
* restore: ManagerType -> ContainerManagerType
* test(containermanager): add empty names fallback test for parsePodmanContainerList
* fix(containermanager): suppress revive stutter lint for ContainerManagerType
* fix(containermanager): use empty string fallback when podman container has no name
* fix(commands): pass real prompter to create command in assemble and ephemeral
* Revert "refactor(containermanager): move shared types and constants to providers common file"
This reverts commit 59faeb71f8.
Since `install` and `uninstall` don't work on the new setup, we're just
stripping them for the moment.
Signed-off-by: Alessio Biancalana <alessio@dottorblaster.it>
* chore(repo): remove shell implementation
* chore(repo): remove bash completion for sub-commands
There is no need for separate files as there will be no dedicated binary
for sub-commands
* chore(repo): remove zsh completion for sub-commands
There is no need for separate files as there will be no dedicated binary
for sub-commands
* chore(repo): delete RFC
We are not using RFC at the moment
* chore(repo): move golang project to the root
* chore(ci): move golang project to the root
* chore(repo): use standard .gitignore for golang projects
source: https://github.com/github/gitignore/blob/main/Go.gitignore
* chore(ci): compatibility CI to handle a golang project
* refactor(ci): run shell script checks against the inside-distrobox files
* refactor(ci): merge ci.yml workflow into main.yml
* fix(assemble): start container only if the flag is provided
* test(containermanager): define mock
* feat(assemble): export apps
* test(assemble): fail on invalid app name
* feat(assemble): exported bins
* test(assemble): fail on invalid bin name
* test(rewrite): add shell-vs-Go compatibility test suite
Compares command generation and flag parity between shell distrobox and
the Go rewrite. Uses a single image (alpine:3.21) since all tests
operate at the command-generation level, not runtime.
Shell output is always the reference — if Go differs it's a failure,
not a skip. Go stderr is captured for diagnostics on flag rejections.
Container targeting is per-name only (no --all) to avoid interfering
with existing distroboxes.
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
* fix add more tests
* fix add more tests
* fix add more tests
* fix(tests): fix malformed test cases in compare.sh
Three value-flag tests were broken by word splitting on unquoted
${flags} expansion — multi-word values caused trailing tokens to
clobber the container name:
- --additional-flags "--ulimit nofile=4096:4096" → --memory=512m
- --init-hooks "echo test-init-hook" → true
- --pre-init-hooks "echo test-pre-init-hook" → true
Also fix flag_slug computation (tr ' -' → tr ' -/:') in all four
loop sites so paths containing / or : don't create bogus filenames,
which silently broke the -H /tmp/dbx-test-home short-flag test.
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
* fix: test refinement
remove version checks
remove ephemeral until we fix upstream
add test that surfaces go vs shell difference
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
* fix: exclude SHLVL from checks, reduce noise
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
* fix(test): remove some noise from env vars
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
* chore: rename output file so that are grouped by operation
* chore(tests): fix linting issues and port comparison tests to POSIX sh
* chore(tests): apply shfmt
---------
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
Co-authored-by: balanza <emanuele@decup.is>
Co-authored-by: Alessio Biancalana <alessio@dottorblaster.it>
Go rewrite emitted --userns keep-id without :size=65536 and
--platform <val> instead of --platform=<val>, diverging from the
shell reference implementation.
Sync assets internal shell with current upstream
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>