This commit is contained in:
Marc Beninca 2024-08-26 14:22:25 +02:00
parent 3d64af5378
commit e6dcf63631
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -178,7 +178,7 @@ _spcd_frame_shut() {
# │ internal │ os │
# ╰──────────┴────╯
spcd_os_cat() {
_spcd_os_cat() {
spcd_cat__file="${1}"
if [ -n "${spcd_cat__file}" ]; then
_spcd_frame_open "${spcd_cat__file}"
@ -313,10 +313,10 @@ spcd_os_sed() {
spcd_os_sed__file="${1}"
shift
if [ -f "${spcd_os_sed__file}" ]; then
spcd_os_cat "${spcd_os_sed__file}"
_spcd_os_cat "${spcd_os_sed__file}"
for spcd_os_sed__regex in "${@}"; do
sed --in-place "s${spcd_os_sed__regex}g" "${spcd_os_sed__file}" &&
spcd_os_cat "${spcd_os_sed__file}"
_spcd_os_cat "${spcd_os_sed__file}"
done
fi
}
@ -326,10 +326,10 @@ spcd_os_write() {
spcd_os_write__text="${2}"
if [ -n "${spcd_os_write__file}" ]; then
[ -f "${spcd_os_write__file}" ] &&
spcd_os_cat "${spcd_os_write__file}"
_spcd_os_cat "${spcd_os_write__file}"
echo "${spcd_os_write__file}"
printf "%s" "${spcd_os_write__text}" >"${spcd_os_write__file}"
spcd_os_cat "${spcd_os_write__file}"
_spcd_os_cat "${spcd_os_write__file}"
fi
}