[#2180] Empty skeleton for pj transfer cleanup task

This commit is contained in:
Frederic Merizen 2018-12-05 16:24:19 +01:00
parent fdf4509573
commit 045579f7ae

View file

@ -0,0 +1,32 @@
namespace :'2018_12_03_finish_piece_jointe_transfer' do
task run: :environment do
Class.new do
def run
notify_dry_run
notify_dry_run
end
def notify_dry_run
if !force?
rake_puts "Dry run, run with FORCE=1 to actually perform changes"
end
end
def force?
if !defined? @force
@force = (ENV['FORCE'].presence || '0').to_i != 0
end
@force
end
def verbose?
if !defined? @verbose
@verbose = (ENV['VERBOSE'].presence || '0').to_i != 0
end
@verbose
end
end.new.run
end
end