Some flags are shared to many commands but not to all (example: `--root`). By composing decorators, each command can be configured so that is assigned only to the flags that matters.
CustomCommand was joined into a string and re-split on whitespace,
collapsing quoted args — `sh -c "echo a || echo b"` lost its script
body, and any value passed by upgrade/assemble with embedded spaces
or quotes got mangled. Pass argv through as []string end-to-end.
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
* fix(create): handle root correctly
The `root` flag is handled in the root cli command. if we re-declare the
flag here we shadow it, resulting in a contaner manager initializated as
non-root.
Before this commit, these two commands produce respectively one root and
one non-root execution
```
distrobox --root create # root
distrobox create --root # non-root
```
* fix(generate-entry): handle root correctly
The `root` flag is handled in the root cli command. if we re-declare the
flag here we shadow it, resulting in a contaner manager initializated as
non-root.
Before this commit, these two commands produce respectively one root and
one non-root execution
```
distrobox --root generate-entry # root
distrobox generate-entry --root # non-root
```
* enter(next): fix unshare_groups su args and tty handling
* test(docker): fix noTTY semantics in buildCommandArgs cases
* cli(enter): fix no-tty help text
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