Had to fix :bucketdir to :bucket_dir

This commit is contained in:
Tristan Ancelet 2024-05-26 12:50:10 -05:00
parent c6f238ae01
commit a41ad51d04

View File

@ -277,8 +277,8 @@ while i < ARGV.count
when '-o', '--output-file' when '-o', '--output-file'
log "user provided ARGV[i.next] == #{ARGV[i.next]}" log "user provided ARGV[i.next] == #{ARGV[i.next]}"
if ARGV[i.next] != "" and not ARGV[i.next] =~ FLAG_REGEX if ARGV[i.next] != "" and not ARGV[i.next] =~ FLAG_REGEX
$CONFIG[:alt_filepath]=ARGV[i.next] $CONFIG[:alt_filepath]=File.expand_path(ARGV[i.next])
log "search_term was set to #{ARGV[i.next]}" log "search_term was set to #{$CONFIG[:alt_filepath]}"
i+=2 i+=2
else else
puts "Flag[#{ARGV[i]}] : Argument[#{ARGV[i.next]}] : Either the argument was not provided or it was a flag" puts "Flag[#{ARGV[i]}] : Argument[#{ARGV[i.next]}] : Either the argument was not provided or it was a flag"
@ -289,8 +289,8 @@ while i < ARGV.count
when '-b', '--bucket' when '-b', '--bucket'
log "user provided ARGV[i.next] == #{ARGV[i.next]}" log "user provided ARGV[i.next] == #{ARGV[i.next]}"
if ARGV[i.next] != "" and not ARGV[i.next] =~ FLAG_REGEX if ARGV[i.next] != "" and not ARGV[i.next] =~ FLAG_REGEX
$CONFIG[:bucketdir]=ARGV[i.next] $CONFIG[:bucket_dir]=ARGV[i.next]
log "$CONFIG[:bucketdir] was set to #{ARGV[i.next]}" log "$CONFIG[:bucket_dir] was set to #{ARGV[i.next]}"
i+=2 i+=2
else else
puts "Flag[#{ARGV[i]}] : Argument[#{ARGV[i.next]}] : Either the argument was not provided or it was a flag" puts "Flag[#{ARGV[i]}] : Argument[#{ARGV[i.next]}] : Either the argument was not provided or it was a flag"
@ -333,8 +333,8 @@ if $CONFIG[:action] == ""
puts "Action was not provided" puts "Action was not provided"
end end
if not Dir.exist? $CONFIG[:bucketdir] if not Dir.exist? $CONFIG[:bucket_dir]
puts "BucketDir[#{$CONFIG[:bucketdir]}] Does not exist. Please check to make sure configuration is correct" puts "BucketDir[#{$CONFIG[:bucket_dir]}] Does not exist. Please check to make sure configuration is correct"
exit exit
end end
@ -350,6 +350,8 @@ case $CONFIG[:action]
if not File.exist? $CONFIG[:search_term] if not File.exist? $CONFIG[:search_term]
puts "File #{$CONFIG[:search_term]} does not exist. Please check to make sure that there are not typos and attempt the run again." puts "File #{$CONFIG[:search_term]} does not exist. Please check to make sure that there are not typos and attempt the run again."
exit exit
else
$CONFIG[:search_term] = File.expand_path($CONFIG[:search_term])
end end
end end