Skip to content
This repository has been archived by the owner on Nov 19, 2018. It is now read-only.

Commit

Permalink
Automatic creating of output path
Browse files Browse the repository at this point in the history
  • Loading branch information
KrauseFx committed Nov 11, 2015
1 parent b161896 commit 3809672
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
5 changes: 2 additions & 3 deletions lib/sigh/download_all.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ def download_all
end

def download_profile(profile)
output = Sigh.config[:output_path] || "/tmp"

FileUtils.mkdir_p(Sigh.config[:output_path])
profile_name = "#{profile.class.pretty_type}_#{profile.app.bundle_id}.mobileprovision" # default name

output_path = File.join(output, profile_name)
output_path = File.join(Sigh.config[:output_path], profile_name)
File.open(output_path, "wb") do |f|
f.write(profile.download)
end
Expand Down
1 change: 1 addition & 0 deletions lib/sigh/manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def self.start
file_name = File.basename(path)
end

FileUtils.mkdir_p(Sigh.config[:output_path])
output = File.join(File.expand_path(Sigh.config[:output_path]), file_name)
begin
FileUtils.mv(path, output)
Expand Down
5 changes: 1 addition & 4 deletions lib/sigh/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,7 @@ def self.available_options
short_option: "-o",
env_name: "SIGH_OUTPUT_PATH",
description: "Directory in which the profile should be stored",
default_value: ".",
verify_block: proc do |value|
raise "Could not find output directory '#{value}'".red unless File.exist?(value)
end),
default_value: "."),
FastlaneCore::ConfigItem.new(key: :cert_id,
short_option: "-i",
env_name: "SIGH_CERTIFICATE_ID",
Expand Down

0 comments on commit 3809672

Please sign in to comment.