checkfile = “arrangement0/list.txt”
task :TTList => checkfile do
regenarate
end
#===================================
So, regenarate function regenarates bunch of files, including the
checkfile. When I call rake, it should run :TTList task, but only if
checkfile is not there. This rakefile runs :TTList even if the
checkfile exists.
So, regenarate function regenarates bunch of files, including the
checkfile. When I call rake, it should run :TTList task, but only if
checkfile is not there. This rakefile runs :TTList even if the
checkfile exists.
I think you probably want:
task :default => checkfile
checkfile = “arrangement0/list.txt”
file checkfile do
regenarate
end
AFAIK tasks are more like functions, dependent on other tasks, which
must be
done first. ‘file’ creates a file task, which will run in order to
create
that target (checkfile).
If you want checkfile to be dependant on other files:
file checkfile => [depfile1, depfile2] do
regenarate
end
So, regenarate function regenarates bunch of files, including the
checkfile. When I call rake, it should run :TTList task, but only if
checkfile is not there. This rakefile runs :TTList even if the
checkfile exists.
If I recall correctly, it works the other way around. You’re defining
the checkfile as a pre-requisite of TTList, so it would only run if
the checkfile was already present. If you remove it, does TTList run?
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.