11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/git_fit/cli/geo_cli.rb', line 11
def detect
config = GitFit::Config.new
db = GitFit::DB::Connection.new(config.db_path).db
amap_key = ENV["AMAP_API_KEY"] || config.sync_config("amap")["api_key"]
detector = GitFit::Geo::DivisionDetector.new(
db: db,
amap_key: amap_key,
batch: options[:batch],
limit: options[:limit],
strategy: options[:strategy],
time_budget: options[:time],
dry_run: options[:"dry-run"],
)
detector.run
rescue => e
say_status :error, "Geo detection failed: #{e.message}", :red
end
|