diff mbox series

[oe-layersetup,09/15] oe-layertool-setup: use subshell execution with redirect

Message ID 20230607200504.3810426-10-rs@ti.com
State Superseded
Delegated to: Ryan Eatmon
Headers show
Series Sacrifice your first born to the linter | expand

Commit Message

Randolph Sapp June 7, 2023, 8:04 p.m. UTC
From: StaticRocket <35777938+StaticRocket@users.noreply.github.com>

Shellcheck:
Consider using { cmd1; cmd2; } >> file instead of individual redirects.

Signed-off-by: StaticRocket <35777938+StaticRocket@users.noreply.github.com>
---
 oe-layertool-setup.sh | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)
diff mbox series

Patch

diff --git a/oe-layertool-setup.sh b/oe-layertool-setup.sh
index b824114..8e29f9a 100755
--- a/oe-layertool-setup.sh
+++ b/oe-layertool-setup.sh
@@ -818,16 +818,18 @@  EOM
 
     if [ -e "$oebase/tmp_append_local.conf" ]
     then
-        echo "" >> "$confdir/local.conf"
-        echo "#====================================================================" >> "$confdir/local.conf"
-        echo "# LOCALCONF: settings from config file:" >> "$confdir/local.conf"
-        echo "#   $inputfile" >> "$confdir/local.conf"
-        echo "#" >> "$confdir/local.conf"
-        echo "# Do not remove." >> "$confdir/local.conf"
-        echo "#--------------------------------------------------------------------" >> "$confdir/local.conf"
-        cat "$oebase/tmp_append_local.conf" >> "$confdir/local.conf"
-        echo "#====================================================================" >> "$confdir/local.conf"
-        echo "" >>  "$confdir/local.conf"
+        {
+            echo "";
+            echo "#====================================================================";
+            echo "# LOCALCONF: settings from config file:";
+            echo "#   $inputfile";
+            echo "#";
+            echo "# Do not remove.";
+            echo "#--------------------------------------------------------------------";
+            cat "$oebase/tmp_append_local.conf";
+            echo "#====================================================================";
+            echo "";
+        } >> "$confdir/local.conf"
         rm "$oebase/tmp_append_local.conf"
     fi
 }