Method: Cnvrg::Dataset.verify_cnvrgignore_exist

Defined in:
lib/cnvrg/dataset.rb

.verify_cnvrgignore_exist(dataset_name, remote) ⇒ Object



103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/cnvrg/dataset.rb', line 103

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