mirror of
https://github.com/ThrowTheSwitch/CMock.git
synced 2026-06-06 05:25:29 +00:00
- CMock should now automatically create root mock directory if it doesn't exist (issue #68)
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
# CMock Project - Automatic Mock Generation for C
|
||||
# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
|
||||
# [Released under MIT License. Please refer to license.txt for details]
|
||||
# ==========================================
|
||||
# ==========================================
|
||||
|
||||
class CMockFileWriter
|
||||
|
||||
@@ -13,6 +13,10 @@ class CMockFileWriter
|
||||
end
|
||||
|
||||
def create_subdir(subdir)
|
||||
if !Dir.exists?("#{@config.mock_path}/")
|
||||
require 'fileutils'
|
||||
FileUtils.mkdir_p "#{@config.mock_path}/"
|
||||
end
|
||||
if subdir && !Dir.exists?("#{@config.mock_path}/#{subdir+'/' if subdir}")
|
||||
require 'fileutils'
|
||||
FileUtils.mkdir_p "#{@config.mock_path}/#{subdir+'/' if subdir}"
|
||||
@@ -28,9 +32,9 @@ class CMockFileWriter
|
||||
end
|
||||
update_file(full_file_name_done, full_file_name_temp)
|
||||
end
|
||||
|
||||
|
||||
private ###################################
|
||||
|
||||
|
||||
def update_file(dest, src)
|
||||
require 'fileutils'
|
||||
FileUtils.rm(dest) if (File.exist?(dest))
|
||||
|
||||
Reference in New Issue
Block a user