Permalink
Browse files

- Add --workdir flag for specifying a place other than the system /tmp

  directory to do work. (Idea by Ryan Petrello)
  • Loading branch information...
1 parent 7c65342 commit 85241b6d1c9d52cf8558e9c09170d197ec9d9f79 @jordansissel committed Sep 12, 2012
Showing with 9 additions and 0 deletions.
  1. +9 −0 lib/fpm/command.rb
View
@@ -4,6 +4,7 @@
require "clamp"
require "ostruct"
require "fpm"
+require "tmpdir" # for Dir.tmpdir
if $DEBUG
Cabin::Channel.get(Kernel).subscribe($stdout)
@@ -170,6 +171,11 @@ class FPM::Command < Clamp::Command
@template_values << kv.split("=", 2)
end
+ option "--workdir", "WORKDIR",
+ "The directory you want fpm to do its work in, where 'work' is any file" \
+ "copying, downloading, etc. Roughly any scratch space fpm needs to build" \
+ "your package.", :default => Dir.tmpdir
+
parameter "[ARGS] ...",
"Inputs to the source package type. For the 'dir' type, this is the files" \
" and directories you want to include in the package. For others, like " \
@@ -221,6 +227,9 @@ def execute
args << "."
end
+ @logger.info("Setting workdir", :workdir => workdir)
+ ENV["TMP"] = workdir
+
validator = Validator.new(self)
if !validator.ok?
validator.messages.each do |message|

0 comments on commit 85241b6

Please sign in to comment.