From d2b716afbae5ef0381c43f7aeda3ac211ae53071 Mon Sep 17 00:00:00 2001 From: trizen Date: Mon, 11 Sep 2017 20:49:06 +0300 Subject: [PATCH] - Replace the absolute path to the home directory with `$ENV{HOME}` inside the dumped configuration output (when they are equal). --- obbrowser | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/obbrowser b/obbrowser index e8a05f3..2a0bf50 100755 --- a/obbrowser +++ b/obbrowser @@ -21,7 +21,7 @@ # Name: obbrowser # License: GPLv3 # Date: 29 December 2012 -# Latest edit: 19 July 2017 +# Latest edit: 11 September 2017 # https://github.com/trizen/obbrowser # --------------------------------------------------------- @@ -135,6 +135,7 @@ sub dump_configuration { open my $config_fh, '>', $config_file or die "Can't open file '${config_file}' for write: $!"; my $dumped_config = q{our $CONFIG = } . Data::Dump::dump(\%CONFIG); + $dumped_config =~ s/\Q$home_dir\E/\$ENV{HOME}/g if ($home_dir eq $ENV{HOME}); print $config_fh $config_documentation, $dumped_config; close $config_fh; }