summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Schlaeger <chris@linux.com>2016-01-24 21:28:26 +0100
committerChris Schlaeger <chris@linux.com>2016-01-24 21:28:26 +0100
commitfcb1cdaeb1c08d0e531ed8763780276bd2700b92 (patch)
treea4cbcfcebf856787bafc09e3c0db5a0b95ca0aa7
parent8f442ca7f4faef29348ac813401497477cf5af56 (diff)
downloadpostrunner-fcb1cdaeb1c08d0e531ed8763780276bd2700b92.zip
Ensure that the html_dir setting in the DB is always updated.
-rw-r--r--lib/postrunner/Main.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/postrunner/Main.rb b/lib/postrunner/Main.rb
index 8f94eeb..9d7c17e 100644
--- a/lib/postrunner/Main.rb
+++ b/lib/postrunner/Main.rb
@@ -46,12 +46,14 @@ module PostRunner
# exists already.
cfg = (@db['config'] ||= @db.new(PEROBS::Hash))
cfg['unit_system'] ||= :metric
- cfg['html_dir'] ||= File.join(@db_dir, 'html')
cfg['version'] ||= VERSION
# We always override the data_dir as the user might have moved the data
# directory. The only reason we store it in the DB is to have it
# available throught the application.
cfg['data_dir'] = @db_dir
+ # Always update html_dir setting so that the DB directory can be moved
+ # around by the user.
+ cfg['html_dir'] = File.join(@db_dir, 'html')
setup_directories
if (errors = @db.check) != 0