~aleteoryx/tclfeed-bsky

ref: 51c2b9dcad80bc80a95eba20014cb4c8da61de7f tclfeed-bsky/config.tcl -rw-r--r-- 569 bytes
51c2b9dcAleteoryx fix sql a month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
if {$argc != 1} {
  puts stderr "Usage: $argv0 </path/to/config/file.ini>"
  exit -1
}
if [catch {set config [::ini::open [lindex $argv 0]]} result] {
  puts stderr "Couldn't open config: $result"
  exit -1
}

namespace eval ::config {
  proc require {config section key} {
    if ![ini::exists $config $section $key] {
      puts stderr "Missing [$section/$key] in config!"
      exit -2
    }
  }
  proc check {config} {
    require $config database path
    require $config database max_posts

    require $config atproto jetstream_host
  }
}

config::check $config