~ihabunek/triglav

ref: f8f7b939d718089aa8ab1b9939d768fd7cf3a2ec triglav/lib/mix/tasks/triglav/import_osm.ex -rw-r--r-- 396 bytes
f8f7b939Ivan Habunek Fix flag for starting only repo 11 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
defmodule Mix.Tasks.Triglav.ImportOsm do
  use Mix.Task

  @shortdoc "Imports the latest OSM data for Croatia from Geofabrik"

  @impl Mix.Task
  def run(args) do
    Application.put_env(:triglav, :repo_only, true)
    {:ok, _} = Application.ensure_all_started(:triglav)

    {opts, _rest} = OptionParser.parse!(args, strict: [force: :boolean])
    Triglav.Import.Osm.run(opts[:force])
  end
end