lib/litestream/commands.rb in litestream-0.3.1-arm64-darwin vs lib/litestream/commands.rb in litestream-0.3.2
- old
+ new
@@ -70,17 +70,23 @@
end
exe_file
end
- def self.replicate
+ def self.replicate(argv = {})
if Litestream.configuration
ENV["LITESTREAM_DATABASE_PATH"] = Litestream.configuration.database_path
ENV["LITESTREAM_REPLICA_URL"] = Litestream.configuration.replica_url
ENV["LITESTREAM_ACCESS_KEY_ID"] = Litestream.configuration.replica_key_id
ENV["LITESTREAM_SECRET_ACCESS_KEY"] = Litestream.configuration.replica_access_key
end
- system(executable, "replicate", "--config", Rails.root.join("config", "litestream.yml").to_s)
+ args = {
+ "--config" => Rails.root.join("config", "litestream.yml").to_s
+ }.merge(argv).to_a.flatten.compact
+
+ command = [executable, "replicate", *args]
+ puts command.inspect
+ system(*command)
end
end
end