Dir.mkdir -> FileUtils.makedirs

when creating a directory for a plugin symlink, the parent directory may
also not yet exist. use FileUtils.makedirs (behaves like mkdir -p)
instead of Dir.mkdir to ensure the full path is created as necessary.

Change-Id: Iafc00c945923c40613fffd9206a1e45ecb735cb6
Reviewed-on: https://gerrit.instructure.com/11915
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
This commit is contained in:
Jacob Fugal 2012-06-27 21:02:09 -06:00
parent 6c572e5505
commit ed19519885
1 changed files with 1 additions and 1 deletions

View File

@ -1,7 +1,7 @@
def maintain_plugin_symlinks(local_path, plugin_path=nil)
plugin_path ||= local_path
Dir.glob("vendor/plugins/*/#{plugin_path}").each do |plugin_dir|
Dir.mkdir("#{local_path}/plugins") unless File.exists?("#{local_path}/plugins")
FileUtils.makedirs("#{local_path}/plugins") unless File.exists?("#{local_path}/plugins")
plugin = plugin_dir.gsub(%r{^vendor/plugins/(.*)/#{plugin_path}$}, '\1')
source = "#{local_path}/plugins/#{plugin}"
target = "#{local_path.gsub(%r{[^/]+}, '..')}/../#{plugin_dir}"