andys-mason 0.1.0 → 0.1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mason/buildpack.rb +1 -1
- data/lib/mason/cli.rb +5 -5
- data/lib/mason.rb +7 -0
- metadata +1 -2
- data/lib/mason/cp_r.rb +0 -7
data/lib/mason/buildpack.rb
CHANGED
@@ -31,7 +31,7 @@ class Mason::Buildpack
|
|
31
31
|
puts " caching in #{cache_dir}"
|
32
32
|
compile_dir = Dir.mktmpdir
|
33
33
|
FileUtils.rm_rf compile_dir
|
34
|
-
|
34
|
+
Mason.cp_R app, compile_dir, :preserve => true
|
35
35
|
FileUtils.mkdir_p cache_dir
|
36
36
|
Dir.chdir(compile_dir) do
|
37
37
|
IO.popen(%{ #{script("compile")} "#{compile_dir}" "#{cache_dir}" }) do |io|
|
data/lib/mason/cli.rb
CHANGED
@@ -63,11 +63,11 @@ class Mason::CLI < Thor
|
|
63
63
|
FileUtils.rm_rf compile_dir
|
64
64
|
FileUtils.rm_rf mason_dir
|
65
65
|
|
66
|
-
|
66
|
+
Mason.cp_R(File.expand_path("~/.mason/buildpacks"), buildpacks_dir,
|
67
67
|
:preserve => true)
|
68
|
-
|
68
|
+
Mason.cp_R(File.expand_path("../../../", __FILE__), mason_dir,
|
69
69
|
:preserve => true)
|
70
|
-
|
70
|
+
Mason.cp_R(app, compile_dir, :preserve => true)
|
71
71
|
|
72
72
|
mason_args = %{ /share/app -q -o /share/output -t #{type} }
|
73
73
|
mason_args += %{ -b "#{options[:buildpack]}" } if options[:buildpack]
|
@@ -78,7 +78,7 @@ class Mason::CLI < Thor
|
|
78
78
|
COMMAND
|
79
79
|
|
80
80
|
FileUtils.rm_rf output
|
81
|
-
|
81
|
+
Mason.cp_R(File.expand_path("~/.mason/share/#{stack}/output"), output,
|
82
82
|
:preserve => true)
|
83
83
|
|
84
84
|
puts "* packaging"
|
@@ -109,7 +109,7 @@ class Mason::CLI < Thor
|
|
109
109
|
raise "img not supported yet"
|
110
110
|
when :dir then
|
111
111
|
FileUtils.rm_rf output
|
112
|
-
|
112
|
+
Mason.cp_R compile_dir, output, :preserve => true
|
113
113
|
else
|
114
114
|
raise "no such output type: #{type}"
|
115
115
|
end
|
data/lib/mason.rb
CHANGED
@@ -2,4 +2,11 @@ module Mason
|
|
2
2
|
|
3
3
|
class CommandFailed < StandardError; end
|
4
4
|
|
5
|
+
# A replacement for FileUtils.cp_r that doesn't barf on symlinks to places that don't exist
|
6
|
+
def self.cp_R(src, dest, options = {})
|
7
|
+
return if options[:noop]
|
8
|
+
output = `cp -vR#{options[:preserve] ? 'p' : ''}#{options[:remove_destination] ? ' --remove-destination' : ''} #{[src,dest].flatten.join ' '}`
|
9
|
+
raise "cp failed: #{output}" unless $?.exitstatus.zero?
|
10
|
+
end
|
11
|
+
|
5
12
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: andys-mason
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.0
|
4
|
+
version: 0.1.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -59,7 +59,6 @@ files:
|
|
59
59
|
- lib/mason/cli.rb
|
60
60
|
- lib/mason/stacks.rb
|
61
61
|
- lib/mason/version.rb
|
62
|
-
- lib/mason/cp_r.rb
|
63
62
|
homepage: http://github.com/andys/mason
|
64
63
|
licenses: []
|
65
64
|
post_install_message:
|
data/lib/mason/cp_r.rb
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
module Mason
|
2
|
-
def self.cp_R(src, dest, options = {})
|
3
|
-
return if options[:noop]
|
4
|
-
output = `cp -vR#{options[:preserve] ? 'p' : ''}#{options[:remove_destination] ? ' --remove-destination' : ''} #{[src,dest].flatten.join ' '}`
|
5
|
-
raise "cp failed: #{output}" unless $?.exitstatus.zero?
|
6
|
-
end
|
7
|
-
end
|