From 006adc8a35565d107c0e949e3989fc590e5294bd Mon Sep 17 00:00:00 2001 From: Sam Ruby Date: Wed, 6 Mar 2019 21:22:53 -0500 Subject: [PATCH] get dashboard minimally running again --- dashboard.rb | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/dashboard.rb b/dashboard.rb index 41a644c..edc9e0a 100755 --- a/dashboard.rb +++ b/dashboard.rb @@ -1,11 +1,12 @@ #!/usr/bin/ruby -require 'rubygems' require 'wunderbar/job-control' require 'time' require 'yaml' -$home = $HOME.sub(/\/?$/, '/') +$HOME ||= ENV['HOME'] + +$home = $HOME.sub(/\/?$/, '/').untaint home_re = /(\$HOME|\~)\// $dashboard = File.join(File.dirname(__FILE__), 'dashboard.yml') @@ -336,9 +337,9 @@ def self.checkdepot(job, status, static=false) _input :name=>'args' _input :type=>'submit', :value=>'submit' - if File.exist? "#$HOME/.awdwr" + if File.exist? "#$home/.awdwr" _h2 'Overrides' - _pre File.read("#$HOME/.awdwr") + _pre File.read("#$home/.awdwr") end end @@ -381,6 +382,11 @@ def self.checkdepot(job, status, static=false) _config config _active active + log end + +Dir["#{__dir__}/*.js"].each do |file| + _file "/#{File.basename(file)}", content: File.read(file) +end + __END__ ENV['SCRIPT_FILENAME'] ||= __FILE__ $dashboard = File.join(File.dirname(ENV['SCRIPT_FILENAME']), 'dashboard.yml')