Skip to content

Commit

Permalink
Allow --inputs to actually work.
Browse files Browse the repository at this point in the history
  • Loading branch information
ohookins committed Nov 17, 2011
1 parent 94aec6a commit cf191b1
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions lib/fpm/program.rb
Expand Up @@ -18,7 +18,6 @@ def initialize
@settings.source = {} # source settings
@settings.target = {} # target settings
@settings.config_files ||= []
@settings.inputs_path = nil # file path to read a list of paths from
@settings.paths = [] # Paths to include in the package

# Maintainer scripts - https://github.com/jordansissel/fpm/issues/18
Expand Down Expand Up @@ -63,13 +62,13 @@ def process_paths(args)
read_from_stdin = args.length == 1 && args.first == '-'

ok = true
if @settings.inputs_path
if @settings.source[:inputs]
if read_from_stdin
$stderr.puts "Error: setting --inputs conflicts with passing '-' as the only argument"
ok = false
end
unless File.file?(@settings.inputs_path)
$stderr.puts "Error: '#{@settings.inputs_path}' does not exist"
unless File.file?(@settings.source[:inputs])
$stderr.puts "Error: '#{@settings.source[:inputs]}' does not exist"
ok = false
end
end
Expand All @@ -79,8 +78,8 @@ def process_paths(args)
if read_from_stdin
paths_iolike = $stdin
end
if @settings.inputs_path
paths_iolike = File.open(@settings.inputs_path, 'r')
if @settings.source[:inputs]
paths_iolike = File.open(@settings.source[:inputs], 'r')
end

paths = []
Expand Down

0 comments on commit cf191b1

Please sign in to comment.