|
|
@ -102,6 +102,10 @@ Kemal.config.extra_options do |parser|
|
|
|
|
puts SOFTWARE.to_pretty_json
|
|
|
|
puts SOFTWARE.to_pretty_json
|
|
|
|
exit
|
|
|
|
exit
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
parser.on("--migrate", "Run any migrations") do
|
|
|
|
|
|
|
|
Invidious::Database::Migrator.new(PG_DB).migrate
|
|
|
|
|
|
|
|
exit
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
Kemal::CLI.new ARGV
|
|
|
|
Kemal::CLI.new ARGV
|
|
|
@ -113,7 +117,10 @@ OUTPUT = CONFIG.output.upcase == "STDOUT" ? STDOUT : File.open(CONFIG.output, mo
|
|
|
|
LOGGER = Invidious::LogHandler.new(OUTPUT, CONFIG.log_level)
|
|
|
|
LOGGER = Invidious::LogHandler.new(OUTPUT, CONFIG.log_level)
|
|
|
|
|
|
|
|
|
|
|
|
# Run migrations
|
|
|
|
# Run migrations
|
|
|
|
Invidious::Database::Migrator.new(PG_DB).migrate
|
|
|
|
if Invidious::Database::Migrator.new(PG_DB).pending_migrations?
|
|
|
|
|
|
|
|
puts "There are pending migrations. Run `invidious --migrate` to apply the migrations."
|
|
|
|
|
|
|
|
exit 46
|
|
|
|
|
|
|
|
end
|
|
|
|
# Check table integrity
|
|
|
|
# Check table integrity
|
|
|
|
Invidious::Database.check_integrity(CONFIG)
|
|
|
|
Invidious::Database.check_integrity(CONFIG)
|
|
|
|
|
|
|
|
|
|
|
|