Method: Cnvrg::Dataset.verify_cnvrgignore_exist
- Defined in:
- lib/cnvrg/dataset.rb
.verify_cnvrgignore_exist(dataset_name, remote) ⇒ Object
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
# File 'lib/cnvrg/dataset.rb', line 125 def self.verify_cnvrgignore_exist(dataset_name,remote) path = ".cnvrgignore" if !File.exist? path path = "#{dataset_name}/.cnvrgignore" end ignore_exits = File.exist? path if !ignore_exits begin list_files = [ path ] FileUtils.touch list_files cnvrgignore = Helpers.cnvrgignore_content File.open(path, "w+") { |f| f.write cnvrgignore } rescue => e return false end end end |