Skip to content

Commit

Permalink
fix: use realpath for fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
c-dilks committed Nov 28, 2023
1 parent e5663a9 commit 2808ba2
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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] > "
Expand Down

0 comments on commit 2808ba2

Please sign in to comment.