lib/sportdb/cli/main.rb in sportdb-1.6.18 vs lib/sportdb/cli/main.rb in sportdb-1.7.0

- old
+ new

@@ -95,10 +95,13 @@ connect_to_db( opts ) LogDb.create WorldDb.create SportDb.create + + SportDb.read_builtin # e.g. seasons.txt etc + puts 'Done.' end # action end # command create @@ -123,10 +126,12 @@ setup = args[0] || 'all' LogDb.create WorldDb.create SportDb.create + + SportDb.read_builtin # e.g. seasons.txt etc WorldDb.read_all( opts.world_data_path ) SportDb.read_setup( "setups/#{setup}", opts.data_path ) puts 'Done.' end # action @@ -150,11 +155,14 @@ connect_to_db( opts ) ## todo: document optional setup profile arg (defaults to all) setup = args[0] || 'all' - SportDb.delete! if o[:delete].present? + if o[:delete].present? + SportDb.delete! + SportDb.read_builtin # NB: reload builtins (e.g. seasons etc.) + end SportDb.read_setup( "setups/#{setup}", opts.data_path ) puts 'Done.' end # action end # command setup @@ -169,10 +177,13 @@ c.action do |g,o,args| connect_to_db( opts ) - SportDb.delete! if o[:delete].present? + if o[:delete].present? + SportDb.delete! + SportDb.read_builtin # NB: reload builtins (e.g. seasons etc.) + end reader = SportDb::Reader.new( opts.data_path ) args.each do |arg| name = arg # File.basename( arg, '.*' ) \ No newline at end of file