mirror of
https://github.com/ViViDboarder/abuse-the-force.git
synced 2024-11-21 22:46:27 +00:00
Clean Temp directories after deploys
This commit is contained in:
parent
a06a150c09
commit
ba855216c7
@ -35,11 +35,26 @@ module AbuseTheForce
|
||||
# Get path to temp project directory
|
||||
temp_path = File.join(Atf_Config.root_dir, TEMP_DIR)
|
||||
|
||||
puts "Config path #{temp_path}"
|
||||
|
||||
# Clear temp dir
|
||||
if Dir.exists? temp_path
|
||||
FileUtils.rm_r temp_path
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
# Builds temp path
|
||||
def self.build_temp
|
||||
|
||||
# Get path to temp project directory
|
||||
temp_path = File.join(Atf_Config.root_dir, TEMP_DIR)
|
||||
|
||||
# If a temp dir exists, clear it
|
||||
if Dir.exists? temp_path
|
||||
self.clean_temp
|
||||
end
|
||||
|
||||
# Make the directory
|
||||
FileUtils.mkdir_p temp_path
|
||||
|
||||
@ -91,6 +106,11 @@ module AbuseTheForce
|
||||
# Get path to temp project directory
|
||||
temp_path = File.join(Atf_Config.root_dir, TEMP_DIR)
|
||||
|
||||
# If temp dir doesn't exist make it
|
||||
unless Dir.exists? temp_path
|
||||
self.build_temp
|
||||
end
|
||||
|
||||
# Get the metadata directory right before filename
|
||||
mdir = File.basename(File.dirname(fpath))
|
||||
|
||||
@ -261,6 +281,9 @@ module AbuseTheForce
|
||||
if options[:target] != nil
|
||||
AbuseTheForce.temp_switch_target
|
||||
end
|
||||
|
||||
# We're done, so clean the path
|
||||
AbuseTheForce.clean_temp
|
||||
end
|
||||
|
||||
desc "test <path to file>", "Deploy and execute a test class"
|
||||
@ -292,6 +315,9 @@ module AbuseTheForce
|
||||
if options[:target] != nil
|
||||
AbuseTheForce.temp_switch_target
|
||||
end
|
||||
|
||||
# We're done, so clean the path
|
||||
AbuseTheForce.clean_temp
|
||||
end
|
||||
|
||||
desc "list <path to list>", "Deploy a list of files"
|
||||
@ -361,6 +387,9 @@ module AbuseTheForce
|
||||
AbuseTheForce.temp_switch_target
|
||||
end
|
||||
end
|
||||
|
||||
# We're done, so clean the path
|
||||
AbuseTheForce.clean_temp
|
||||
end
|
||||
|
||||
desc "project", "Deploy a whole project"
|
||||
|
Loading…
Reference in New Issue
Block a user