Permalink
Browse files

Use tmpdir for installation, and cleanup

  • Loading branch information...
1 parent b598544 commit 213bf496dd4f631e877bb6a2ecd27c83fa9c2132 @agelwarg committed Sep 16, 2010
Showing with 4 additions and 1 deletion.
  1. +4 −1 bin/pdfkit
View
@@ -53,11 +53,14 @@ def install_binary(binary)
architecture = ENV['ARCHITECTURE'] || detect_architecture
install_to = ENV['TO'] || PDFKit.configuration.method(binary).call
- Dir.chdir '/tmp'
+ tmpdir = "/tmp/pdfkit.#{$$}"
+ Dir.mkdir tmpdir
+ Dir.chdir tmpdir
cleanup(binary,install_to)
download = download(binary,architecture)
install(binary,download, architecture, install_to)
+ `rm -rf #{tmpdir}`
end
OptionParser.new do |parser|

0 comments on commit 213bf49

Please sign in to comment.