self/install/code

This commit is contained in:
Marc Beninca 2024-12-08 22:37:36 +01:00
parent 6d33252ea4
commit 2c3167178e
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -63,9 +63,14 @@ rwx_self_init() {
_rwx_cmd_rwx_install() { rwx_self_install "${@}"; }
rwx_self_install() {
local target="${1}"
local command file
[ -n "${target}" ] || exit
local command file root
# code
root="${target}${RWX_ROOT_SYSTEM}"
rwx_remove "${root}"
cp --recursive "${RWX_ROOT_SYSTEM}" "${root}"
# commands
local root="${target}/usr/local/bin"
root="${target}/usr/local/bin"
for command in $(rwx_self_commands); do
file="${root}/${command}"
rwx_remove "${file}"