xqcoretools 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/bin/xqcoretools +23 -24
- metadata +2 -2
data/bin/xqcoretools
CHANGED
@@ -38,38 +38,37 @@ class XQCoreTools < Thor
|
|
38
38
|
|
39
39
|
desc "bundle [OUTPUT] [PATHS]", "Adds files to an existing bundle"
|
40
40
|
def bundle(output, paths)
|
41
|
-
|
42
|
-
puts "Output must point to an existing bundle"
|
43
|
-
return;
|
44
|
-
end
|
41
|
+
contentDirectory = "#{output}/content"
|
45
42
|
|
46
|
-
contentDirectory
|
43
|
+
FileUtils.rm_r(contentDirectory, :force=>true)
|
47
44
|
|
48
|
-
FileUtils.
|
49
|
-
|
50
|
-
pathList = paths.split(';')
|
45
|
+
FileUtils.mkdir(contentDirectory)
|
51
46
|
|
52
|
-
|
47
|
+
pathList = paths.split(';')
|
48
|
+
packagesList = []
|
53
49
|
|
54
50
|
pathList.each do |path|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
if File.file? subPath
|
66
|
-
puts "COPYING: #{relPath}"
|
67
|
-
else
|
68
|
-
if item != '.' && item != '..'
|
69
|
-
XQCoreTools::logFilesRecursive(subPath, relPath)
|
51
|
+
Dir.foreach(path) do |item|
|
52
|
+
subPath = "#{path}/#{item}"
|
53
|
+
if File.file? subPath
|
54
|
+
if item != '.DS_Store'
|
55
|
+
packagesList.push subPath
|
56
|
+
end
|
57
|
+
else
|
58
|
+
if item != '.' && item != '..'
|
59
|
+
packagesList.push subPath
|
60
|
+
end
|
70
61
|
end
|
71
62
|
end
|
72
63
|
end
|
64
|
+
|
65
|
+
puts "BUNDLE: #{output}"
|
66
|
+
|
67
|
+
packagesList.each do |package|
|
68
|
+
FileUtils.cp_r(package, contentDirectory)
|
69
|
+
|
70
|
+
puts "COPYING: #{package}"
|
71
|
+
end
|
73
72
|
end
|
74
73
|
end
|
75
74
|
|