cnvrg 1.4.9.2 → 1.4.9.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cnvrg/dataset.rb +18 -25
- data/lib/cnvrg/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57cfbe5e8781c875703c195139bb558edd39db3c70d35920efc48152412f63d2
|
4
|
+
data.tar.gz: 35c51593cfef1e3a54e33a95f801e5b09114df80ce5be03f2770408cc33bb0f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b60b3f6689af7a7d7446a52cf01c34043af9811ad3e132a5788372b51bbc83cd429ffe94d899ca53121018d3328028b14d82046bf1d0be22fefa0118fb0a17e3
|
7
|
+
data.tar.gz: 3c083bf5f3dc563a4863b34ba0db6a82e53f134c324b2d37e20ad08dbfc9ad9e6809e3778df197a897a43df2538a18f571293ae2e26bc62a484d738f91c56d22
|
data/lib/cnvrg/dataset.rb
CHANGED
@@ -29,18 +29,18 @@ module Cnvrg
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def init_home(remote: false)
|
32
|
-
dataset_home = Dir.pwd
|
33
|
-
if
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
exit(1)
|
32
|
+
dataset_home = File.join(Dir.pwd, @slug)
|
33
|
+
if Dir.exists? dataset_home
|
34
|
+
if !remote
|
35
|
+
Cnvrg::CLI.log_message("Error: Conflict with dir #{@slug}", Thor::Shell::Color::RED)
|
36
|
+
if Thor::Shell::Basic.new.no? "Sync to repository anyway? (current data might lost)", Thor::Shell::Color::YELLOW
|
37
|
+
Cnvrg::CLI.log_message("Remove dir in order to clone #{@slug}", Thor::Shell::Color::RED)
|
38
|
+
exit(1)
|
39
|
+
end
|
41
40
|
end
|
42
41
|
FileUtils.rm_rf(dataset_home)
|
43
42
|
end
|
43
|
+
|
44
44
|
# if Dataset.clone(owner, dataset_name, slug, remote)
|
45
45
|
Dataset.clone(@owner, @slug, @slug, remote)
|
46
46
|
@local_path = dataset_home
|
@@ -378,35 +378,28 @@ module Cnvrg
|
|
378
378
|
end
|
379
379
|
|
380
380
|
def clone(commit)
|
381
|
-
|
382
|
-
|
383
|
-
return response
|
381
|
+
return
|
384
382
|
end
|
385
383
|
|
386
384
|
def self.clone(owner, dataset_name, dataset_slug, remote = false)
|
387
385
|
begin
|
388
386
|
list_dirs = []
|
389
|
-
|
390
|
-
|
387
|
+
if !remote
|
388
|
+
list_dirs << dataset_name
|
389
|
+
end
|
390
|
+
list_dirs << "#{dataset_name}/.cnvrg"
|
391
391
|
list_files = [
|
392
|
-
".
|
393
|
-
".cnvrg/config.yml"
|
392
|
+
"#{dataset_name}/.cnvrg/config.yml",
|
394
393
|
]
|
395
394
|
|
396
395
|
config = {dataset_name: dataset_name,
|
397
396
|
dataset_slug: dataset_slug,
|
398
397
|
owner: owner}
|
399
|
-
|
400
|
-
if not remote
|
401
|
-
list_dirs = list_dirs.map {|x| prefix+x}
|
402
|
-
list_dirs << dataset_name
|
403
|
-
list_files = list_files.map {|x| prefix+x}
|
404
|
-
config_yml_path = prefix + config_yml_path
|
405
|
-
end
|
398
|
+
|
406
399
|
|
407
400
|
FileUtils.mkdir_p list_dirs
|
408
401
|
FileUtils.touch list_files
|
409
|
-
File.open(
|
402
|
+
File.open("#{dataset_name}/.cnvrg/config.yml", "w+") {|f| f.write config.to_yaml}
|
410
403
|
rescue => e
|
411
404
|
puts "Exception in clone request:#{e.message}"
|
412
405
|
return false
|
@@ -442,7 +435,7 @@ module Cnvrg
|
|
442
435
|
|
443
436
|
def write_success(in_folder = false)
|
444
437
|
file_path = ".cnvrg/config.yml"
|
445
|
-
file_path =
|
438
|
+
file_path = File.join(@local_path || @working_dir, file_path)
|
446
439
|
if File.exist?(file_path)
|
447
440
|
File.open(file_path, "a") {|f| f.puts(":success: true")}
|
448
441
|
end
|
data/lib/cnvrg/version.rb
CHANGED