fpm-cookery 0.12.0 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md
CHANGED
@@ -31,11 +31,11 @@ module FPM
|
|
31
31
|
when '.zip'
|
32
32
|
safesystem('unzip', '-d', local_path.basename('.zip'), local_path)
|
33
33
|
else
|
34
|
-
|
34
|
+
if !local_path.directory? && !local_path.basename.exist?
|
35
35
|
Dir.mkdir(local_path.basename)
|
36
36
|
end
|
37
37
|
|
38
|
-
|
38
|
+
FileUtils.cp_r(local_path, local_path.basename)
|
39
39
|
end
|
40
40
|
extracted_source
|
41
41
|
end
|
@@ -5,23 +5,18 @@ require 'fileutils'
|
|
5
5
|
module FPM
|
6
6
|
module Cookery
|
7
7
|
class SourceHandler
|
8
|
-
class LocalPath < FPM::Cookery::SourceHandler::
|
8
|
+
class LocalPath < FPM::Cookery::SourceHandler::Curl
|
9
9
|
CHECKSUM = false
|
10
10
|
NAME = :local_path
|
11
11
|
|
12
12
|
def fetch
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
FileUtils.rm_rf(extracted_source)
|
22
|
-
FileUtils.cp_r(source.path, extracted_source)
|
23
|
-
|
24
|
-
extracted_source
|
13
|
+
if local_path.exist?
|
14
|
+
Log.info "Using cached file #{local_path}"
|
15
|
+
else
|
16
|
+
Log.info "Copying #{source.path} to cache"
|
17
|
+
FileUtils.cp_r(source.path, cachedir)
|
18
|
+
end
|
19
|
+
local_path
|
25
20
|
end
|
26
21
|
end
|
27
22
|
end
|
data/lib/fpm/cookery/version.rb
CHANGED