mirror of
https://github.com/89luca89/distrobox.git
synced 2025-02-25 18:55:25 -06:00
assemble: add support for declaring exported apps and binaries, Fix #842
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
This commit is contained in:
@@ -47,6 +47,9 @@ start_now=""
|
||||
unshare_ipc=""
|
||||
unshare_netns=""
|
||||
volume=""
|
||||
exported_apps=""
|
||||
exported_bins=""
|
||||
exported_bins_path="${HOME}/.local/bin"
|
||||
|
||||
# Cleanup tmpfiles on exit
|
||||
trap 'rm -f ${tmpfile}' EXIT
|
||||
@@ -314,6 +317,22 @@ run_distrobox() (
|
||||
if [ -n "${start_now}" ] && [ "${start_now}" -eq 1 ]; then
|
||||
"${distrobox_path}"/distrobox enter "${name}" -- touch /dev/null
|
||||
fi
|
||||
|
||||
# if there are exported bins and apps declared, let's export them
|
||||
if [ -n "${exported_apps}" ] || [ -n "${exported_bins}" ]; then
|
||||
# First we start the container
|
||||
"${distrobox_path}"/distrobox enter "${name}" -- touch /dev/null
|
||||
|
||||
IFS=" "
|
||||
for app in ${exported_apps}; do
|
||||
"${distrobox_path}"/distrobox enter "${name}" -- distrobox-export --app "${app}"
|
||||
done
|
||||
|
||||
IFS=" "
|
||||
for bin in ${exported_bins}; do
|
||||
"${distrobox_path}"/distrobox enter "${name}" -- distrobox-export --bin "${bin}" --export-path "${exported_bins_path}"
|
||||
done
|
||||
fi
|
||||
)
|
||||
|
||||
# Sanitize an input, add single/double quotes and escapes
|
||||
|
||||
@@ -150,3 +150,6 @@ in order to execute them one after the other.
|
||||
init_hooks=ln -sf /usr/bin/distrobox-host-exec /usr/local/bin/flatpak;
|
||||
init_hooks=ln -sf /usr/bin/distrobox-host-exec /usr/local/bin/podman;
|
||||
init_hooks=ln -sf /usr/bin/distrobox-host-exec /usr/local/bin/xdg-open;
|
||||
exported_apps="htop"
|
||||
exported_bins="/usr/bin/htop /usr/bin/git"
|
||||
exported_bins_path="~/.local/bin"
|
||||
|
||||
@@ -83,3 +83,6 @@ init_hooks=ln -sf /usr/bin/distrobox-host-exec /usr/local/bin/docker-compose;
|
||||
init_hooks=ln -sf /usr/bin/distrobox-host-exec /usr/local/bin/flatpak;
|
||||
init_hooks=ln -sf /usr/bin/distrobox-host-exec /usr/local/bin/podman;
|
||||
init_hooks=ln -sf /usr/bin/distrobox-host-exec /usr/local/bin/xdg-open;
|
||||
exported_apps="htop"
|
||||
exported_bins="/usr/bin/htop /usr/bin/git"
|
||||
exported_bins_path="~/.local/bin"
|
||||
|
||||
@@ -277,5 +277,8 @@ init_hooks=ln -sf /usr/bin/distrobox-host-exec /usr/local/bin/docker-compose;
|
||||
init_hooks=ln -sf /usr/bin/distrobox-host-exec /usr/local/bin/flatpak;
|
||||
init_hooks=ln -sf /usr/bin/distrobox-host-exec /usr/local/bin/podman;
|
||||
init_hooks=ln -sf /usr/bin/distrobox-host-exec /usr/local/bin/xdg-open;
|
||||
exported_apps=\[dq]htop\[dq]
|
||||
exported_bins=\[dq]/usr/bin/htop /usr/bin/git\[dq]
|
||||
exported_bins_path=\[dq]\[ti]/.local/bin\[dq]
|
||||
\f[R]
|
||||
.fi
|
||||
|
||||
@@ -277,6 +277,9 @@ init_hooks=ln -sf /usr/bin/distrobox-host-exec /usr/local/bin/docker-compose;
|
||||
init_hooks=ln -sf /usr/bin/distrobox-host-exec /usr/local/bin/flatpak;
|
||||
init_hooks=ln -sf /usr/bin/distrobox-host-exec /usr/local/bin/podman;
|
||||
init_hooks=ln -sf /usr/bin/distrobox-host-exec /usr/local/bin/xdg-open;
|
||||
exported_apps=\[dq]htop\[dq]
|
||||
exported_bins=\[dq]/usr/bin/htop /usr/bin/git\[dq]
|
||||
exported_bins_path=\[dq]\[ti]/.local/bin\[dq]
|
||||
\f[R]
|
||||
.fi
|
||||
'\" t
|
||||
|
||||
Reference in New Issue
Block a user