From 31ca2c6117fd9726944205e63f20163b207d570a Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 31 Aug 2024 01:13:08 +0200 Subject: [PATCH] os/write --- spcd/bootstrap.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/spcd/bootstrap.sh b/spcd/bootstrap.sh index 6764c83..c80c600 100644 --- a/spcd/bootstrap.sh +++ b/spcd/bootstrap.sh @@ -273,14 +273,14 @@ spcd_os_sed() { } spcd_os_write() { - spcd_os_write__file="${1}" - spcd_os_write__text="${2}" - if [ -n "${spcd_os_write__file}" ]; then - [ -f "${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}" + local file="${1}" + local text="${2}" + if [ -n "${file}" ]; then + [ -f "${file}" ] && + _spcd_os_cat "${file}" + echo "→ ${file}" + printf "%s" "${text}" >"${file}" + _spcd_os_cat "${file}" fi }