Class: Rscons::Builders::Directory
- Inherits:
-
Rscons::Builder
- Object
- Rscons::Builder
- Rscons::Builders::Directory
- Defined in:
- lib/rscons/builders/directory.rb
Overview
The Directory builder creates a directory.
Instance Method Summary collapse
-
#run(target, sources, cache, env, vars) ⇒ String, false
Run the builder to produce a build target.
Methods inherited from Rscons::Builder
#create_build_target, #default_variables, #features, #finalize, #name, #produces?, #setup, #standard_build, #standard_finalize, #standard_threaded_build
Instance Method Details
#run(target, sources, cache, env, vars) ⇒ String, false
Run the builder to produce a build target.
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/rscons/builders/directory.rb', line 16 def run(target, sources, cache, env, vars) if File.directory?(target) target elsif File.exists?(target) Ansi.write($stderr, :red, "Error: `#{target}' already exists and is not a directory", :reset, "\n") false else env.("Directory #{target}", nil) cache.mkdir_p(target) target end end |