This commit is contained in:
parent
9e785b7ce1
commit
1cad82456e
3 changed files with 13 additions and 2 deletions
4
sh/fs.sh
4
sh/fs.sh
|
@ -1,3 +1,7 @@
|
||||||
|
# ╭────╮
|
||||||
|
# │ fs │
|
||||||
|
# ╰────╯
|
||||||
|
|
||||||
rwx_fs_make_btrfs() {
|
rwx_fs_make_btrfs() {
|
||||||
local device="${1}"
|
local device="${1}"
|
||||||
local label="${2}"
|
local label="${2}"
|
||||||
|
|
|
@ -84,12 +84,14 @@ rwx_find_shell() {
|
||||||
# │ main │ ifs │
|
# │ main │ ifs │
|
||||||
# ╰──────┴─────╯
|
# ╰──────┴─────╯
|
||||||
|
|
||||||
|
# set internal field separator to line feed
|
||||||
rwx_ifs_set() {
|
rwx_ifs_set() {
|
||||||
_RWX_IFS="${IFS}"
|
_RWX_IFS="${IFS}"
|
||||||
IFS="
|
IFS="
|
||||||
"
|
"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# unset internal field separator
|
||||||
rwx_ifs_unset() {
|
rwx_ifs_unset() {
|
||||||
IFS="${_RWX_IFS}"
|
IFS="${_RWX_IFS}"
|
||||||
unset RWX_IFS
|
unset RWX_IFS
|
||||||
|
@ -99,6 +101,7 @@ rwx_ifs_unset() {
|
||||||
# │ main │ source │
|
# │ main │ source │
|
||||||
# ╰──────┴────────╯
|
# ╰──────┴────────╯
|
||||||
|
|
||||||
|
# source code from file path
|
||||||
rwx_source() {
|
rwx_source() {
|
||||||
local path="${1}"
|
local path="${1}"
|
||||||
[ -d "${path}" ] ||
|
[ -d "${path}" ] ||
|
||||||
|
|
|
@ -92,7 +92,7 @@ rwx_self_init() {
|
||||||
_rwx_cmd_rwx_install() { rwx_self_install "${@}"; }
|
_rwx_cmd_rwx_install() { rwx_self_install "${@}"; }
|
||||||
rwx_self_install() {
|
rwx_self_install() {
|
||||||
local target="${1}"
|
local target="${1}"
|
||||||
local command file root
|
local command file name root
|
||||||
# code
|
# code
|
||||||
if [ -n "${target}" ]; then
|
if [ -n "${target}" ]; then
|
||||||
root="${target}${RWX_ROOT_SYSTEM}"
|
root="${target}${RWX_ROOT_SYSTEM}"
|
||||||
|
@ -101,10 +101,14 @@ rwx_self_install() {
|
||||||
fi
|
fi
|
||||||
# commands
|
# commands
|
||||||
root="${target}/usr/local/bin"
|
root="${target}/usr/local/bin"
|
||||||
|
name="${RWX_SELF_NAME}.sh"
|
||||||
|
file="${root}/${name}"
|
||||||
|
rwx_remove "${file}"
|
||||||
|
rwx_link "${file}" "${RWX_MAIN_PATH}"
|
||||||
for command in $(rwx_self_commands); do
|
for command in $(rwx_self_commands); do
|
||||||
file="${root}/${command}"
|
file="${root}/${command}"
|
||||||
rwx_remove "${file}"
|
rwx_remove "${file}"
|
||||||
rwx_link "${file}" "${RWX_MAIN_PATH}"
|
rwx_link "${file}" "${name}"
|
||||||
done
|
done
|
||||||
# sh
|
# sh
|
||||||
file="${target}/etc/profile.d/${RWX_SELF_NAME}.sh"
|
file="${target}/etc/profile.d/${RWX_SELF_NAME}.sh"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue