nhmood / watson-ruby

inline issue manager
MIT License
634 stars 50 forks source link

Should we clean the dir before adding here? [lib/watson/command.rb] #168

Closed nhmood closed 10 years ago

nhmood commented 10 years ago

filename : lib/watson/command.rb line # : 271 tag : review md5 : d80c71d6d9f52b99a0eb046266425638

     # [review] - Should we clean the dir before adding here?
     # For each argument passed, make sure valid, then add to @config.dir_list
     args.each do | _dir |
       # Error check on input
       if !Watson::FS.check_dir(_dir)
         print "Unable to open #{ _dir }\n"
       else
         # Clean up path, remove trailing forward slashes
         _dir = _dir.gsub(/(\/)+$/, "")
         if !_dir.empty?
           debug_print "Adding #{ _dir } to config dir_list\n"
           @config.dir_list.push(_dir)
         end
       end
     end
         debug_print "Updated dirs: #{ @config.dir_list }\n"