From 2808ba2ecddf733025ea0c702c65d97728dd91d0 Mon Sep 17 00:00:00 2001 From: Christopher Dilks Date: Tue, 28 Nov 2023 17:59:17 -0500 Subject: [PATCH] fix: use `realpath` for `fmt` --- install.rb | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/install.rb b/install.rb index 91d0ee73..79bdb36e 100755 --- a/install.rb +++ b/install.rb @@ -30,14 +30,25 @@ parser.on("--purge", "Remove the installation at [INSTALL DIR] beforehand") parser.parse!(into: options) +# check for HIPO installation, or fallback to $HIPO +options[:hipo] = ENV['HIPO'] unless Dir.exists? options[:hipo] + +# use realpaths for dependencies +[ :hipo, :fmt ].each do |dep| + unless options[dep].nil? + if Dir.exists? options[dep] + options[dep] = File.realpath options[dep] + else + $stderr.puts "ERROR: directory '#{options[dep]}' for option '--#{dep.to_s}' does not exist" + exit 1 + end + end +end + # print the options puts "SET OPTIONS:" options.each do |k,v| puts "#{k.to_s.rjust 15} => #{v}" end -# check for HIPO installation, or fallback to $HIPO -options[:hipo] = ENV['HIPO'] unless Dir.exists? options[:hipo] -options[:hipo] = File.realpath options[:hipo] if Dir.exists? options[:hipo] - # clean and purge def rmDir(dir,obj='files') print "\nRemove #{obj} at #{dir} ?\n[y/N] > "