Sha256: f146bcbe530115fa855bfc1d8938e6a971652bbd2b29ba1fee35631f6fa963ff
Contents?: true
Size: 942 Bytes
Versions: 7
Compression:
Stored size: 942 Bytes
Contents
module Rscons module Builders # The Directory builder creates a directory. class Directory < Builder # Run the builder to produce a build target. # # @param target [String] Target file name. # @param sources [Array<String>] Source file name(s). # @param cache [Cache] The Cache object. # @param env [Environment] The Environment executing the builder. # @param vars [Hash,VarSet] Extra construction variables. # # @return [String,false] # Name of the target file on success or false on failure. def run(target, sources, cache, env, vars) if File.directory?(target) target elsif File.exists?(target) $stderr.puts "Error: `#{target}' already exists and is not a directory" false else puts "Directory #{target}" cache.mkdir_p(target) target end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems