aboutsummaryrefslogtreecommitdiff
path: root/sboconfig
diff options
context:
space:
mode:
authorAndreas Guldstrand <andreas.guldstrand@gmail.com>2016-07-21 00:02:55 +0200
committerAndreas Guldstrand <andreas.guldstrand@gmail.com>2016-07-21 00:02:55 +0200
commitac919a733a5e7b27472d69b433447406310f2144 (patch)
tree6c06b914e128f0ad9fe32f2fc7f45b68bab9e461 /sboconfig
parentf211e8fd7f05d035f473056c4b1a63c617e472e3 (diff)
downloadsbotools-ac919a733a5e7b27472d69b433447406310f2144.tar.xz
sboconfig: Just pass in all %changes to config_write()
Diffstat (limited to 'sboconfig')
-rwxr-xr-xsboconfig7
1 files changed, 2 insertions, 5 deletions
diff --git a/sboconfig b/sboconfig
index f3bba1d..a621207 100755
--- a/sboconfig
+++ b/sboconfig
@@ -135,6 +135,7 @@ sub config_write {
while (@_ >= 2) {
my $key = shift;
my $val = shift;
+ say "Setting $key to $val...";
if ($conf =~ /^\Q$key\E=/m) {
$conf =~ s/^\Q$key\E=.*$/$key=$val/m;
@@ -177,10 +178,6 @@ sub _fixup_conf {
$_[0] = join "\n", @fixed, ''; # make sure we end with a newline if there are any lines
}
-for my $key (keys %changes) {
- my $value = $changes{$key};
- say "Setting $key to $value...";
- config_write($key, $value);
-}
+config_write(%changes) if %changes;
exit 0;