update module URL, fix bool config options; v0.5.0

This commit is contained in:
Iris Lightshard 2023-01-30 21:23:56 -07:00
parent ab1b85079f
commit ea6a8598d8
Signed by: Iris Lightshard
GPG key ID: 3B7FBC22144E6398
8 changed files with 27 additions and 35 deletions

View file

@ -2,7 +2,7 @@ package archetype
import ( import (
"fmt" "fmt"
"nilfm.cc/git/quartzgun/auth" "hacklab.nilfm.cc/quartzgun/auth"
"strings" "strings"
) )

View file

@ -2,6 +2,7 @@ package archetype
import ( import (
"errors" "errors"
"fmt"
"io/ioutil" "io/ioutil"
"os" "os"
"os/exec" "os/exec"
@ -28,6 +29,7 @@ func (self *EurekaAdapter) Init(cfg *Config) {
err = self.readCfg() err = self.readCfg()
if err != nil { if err != nil {
fmt.Printf(err.Error())
panic("config.h is malformed!") panic("config.h is malformed!")
} }
} }
@ -312,7 +314,10 @@ func (self *EurekaAdapter) readCfg() error {
return err return err
} }
fileData := string(f[:]) fileData := strings.Replace(
strings.Replace(
string(f[:]), "/* clang-format on */", "", -1),
"/* clang-format off */", "", -1)
macros := strings.Split(fileData, "#define ")[1:] macros := strings.Split(fileData, "#define ")[1:]
for _, macro := range macros { for _, macro := range macros {
@ -384,6 +389,7 @@ func (self *EurekaAdapter) writeCfg() error {
defer f.Close() defer f.Close()
f.WriteString("/* clang-format off */\n");
for k, v := range self.Config { for k, v := range self.Config {
switch k.Type { switch k.Type {
case "int": case "int":
@ -407,8 +413,10 @@ func (self *EurekaAdapter) writeCfg() error {
v = strings.ReplaceAll(v, "\r", "") v = strings.ReplaceAll(v, "\r", "")
f.WriteString("#define " + k.Name + " \"" + v + "\"\n") f.WriteString("#define " + k.Name + " \"" + v + "\"\n")
default: default:
return errors.New("Unsupported config value type: " + k.Type) fmt.Println("Unsupported config value type: " + k.Type)
} }
} }
f.WriteString("/* clang-format on */\n");
return nil return nil
} }

4
go.mod
View file

@ -1,7 +1,7 @@
module nilfm.cc/git/nirvash module hacklab.nilfm.cc/nirvash
go 1.17 go 1.17
require nilfm.cc/git/quartzgun v0.2.0 require hacklab.nilfm.cc/quartzgun v0.3.0
require golang.org/x/crypto v0.0.0-20220518034528-6f7dac969898 // indirect require golang.org/x/crypto v0.0.0-20220518034528-6f7dac969898 // indirect

23
go.sum
View file

@ -1,4 +1,3 @@
golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3 h1:0es+/5331RGQPcXlMfP+WrnIIS6dNnNRe0WB02W0F4M=
golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20220518034528-6f7dac969898 h1:SLP7Q4Di66FONjDJbCYrCRrh97focO6sLogHO7/g8F0= golang.org/x/crypto v0.0.0-20220518034528-6f7dac969898 h1:SLP7Q4Di66FONjDJbCYrCRrh97focO6sLogHO7/g8F0=
golang.org/x/crypto v0.0.0-20220518034528-6f7dac969898/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220518034528-6f7dac969898/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
@ -9,23 +8,5 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
nilfm.cc/git/quartzgun v0.0.0-20220516042416-1dbca325d20a h1:NtR/vUiY7nhEARMOXgabxwd4Z2kbC/z0AJgtpQ04ai0= hacklab.nilfm.cc/quartzgun v0.3.0 h1:nOTZaKaKv7q+08Y5vghOIYoMO9g+FAYQUyHzcQP6jUU=
nilfm.cc/git/quartzgun v0.0.0-20220516042416-1dbca325d20a/go.mod h1:YqXoEQkRNOU1fZXeq5r2kTzvNbaH2VmULRP9an/sBX4= hacklab.nilfm.cc/quartzgun v0.3.0/go.mod h1:P6qK4HB0CD/xfyRq8wdEGevAPFDDmv0KCaESSvv93LU=
nilfm.cc/git/quartzgun v0.0.0-20220516045132-9bf93d5c7575 h1:68aITeSQJ2EMuyWVNPsQvYw9W/sUsbzt2CNyg6Jg7bs=
nilfm.cc/git/quartzgun v0.0.0-20220516045132-9bf93d5c7575/go.mod h1:/DDvt1DtzNuUf3HHaP29WMei/kkdaRW+ySmEzybvVto=
nilfm.cc/git/quartzgun v0.0.0-20220516045804-ac526a0d7890 h1:R+jc5HoSg88gUlj5tVsm9ZsEkaNw0i+4e9xzeCJE9ig=
nilfm.cc/git/quartzgun v0.0.0-20220516045804-ac526a0d7890/go.mod h1:/DDvt1DtzNuUf3HHaP29WMei/kkdaRW+ySmEzybvVto=
nilfm.cc/git/quartzgun v0.0.0-20220516052922-27b61b7e68a2 h1:xufV1FtykeEITJegz7qSqQOnsESTt1mIBJ09zAAzpgg=
nilfm.cc/git/quartzgun v0.0.0-20220516052922-27b61b7e68a2/go.mod h1:/DDvt1DtzNuUf3HHaP29WMei/kkdaRW+ySmEzybvVto=
nilfm.cc/git/quartzgun v0.0.0-20220516055202-14a8c12fd440 h1:R1b9Jl6vDVAaCs+MaYI4LMVVajwQ2jGZcqDL8L33SA0=
nilfm.cc/git/quartzgun v0.0.0-20220516055202-14a8c12fd440/go.mod h1:/DDvt1DtzNuUf3HHaP29WMei/kkdaRW+ySmEzybvVto=
nilfm.cc/git/quartzgun v0.0.0-20220516061509-0e5a81f27b63 h1:HlIWrDDJjOFLrxPQzldzDz78K8Z5NDtTCoYkmmI8/JA=
nilfm.cc/git/quartzgun v0.0.0-20220516061509-0e5a81f27b63/go.mod h1:/DDvt1DtzNuUf3HHaP29WMei/kkdaRW+ySmEzybvVto=
nilfm.cc/git/quartzgun v0.1.0 h1:G+f/UnGpm5FAEqaY3Lj5UHvq0eB5sytM5s4FLesLC3E=
nilfm.cc/git/quartzgun v0.1.0/go.mod h1:/DDvt1DtzNuUf3HHaP29WMei/kkdaRW+ySmEzybvVto=
nilfm.cc/git/quartzgun v0.1.1 h1:swJg3im4YsD64MnfJHa2Bxm0adGT/ArAMHLAPeEjuS0=
nilfm.cc/git/quartzgun v0.1.1/go.mod h1:/DDvt1DtzNuUf3HHaP29WMei/kkdaRW+ySmEzybvVto=
nilfm.cc/git/quartzgun v0.1.2 h1:B0IN24Y1Bg2IVvKxXXVtTUNFdVL8h3k/r0+LFAyqtMI=
nilfm.cc/git/quartzgun v0.1.2/go.mod h1:/DDvt1DtzNuUf3HHaP29WMei/kkdaRW+ySmEzybvVto=
nilfm.cc/git/quartzgun v0.2.0 h1:JJjkCbRLaMmfGLe5GQHWhBkkY6Is0roTMyWC76VtBPI=
nilfm.cc/git/quartzgun v0.2.0/go.mod h1:/DDvt1DtzNuUf3HHaP29WMei/kkdaRW+ySmEzybvVto=

View file

@ -3,7 +3,7 @@ package lfo
import ( import (
"context" "context"
"net/http" "net/http"
core "nilfm.cc/git/nirvash/archetype" core "hacklab.nilfm.cc/nirvash/archetype"
"strings" "strings"
) )

View file

@ -3,12 +3,12 @@ package main
import ( import (
"html/template" "html/template"
"net/http" "net/http"
core "nilfm.cc/git/nirvash/archetype" core "hacklab.nilfm.cc/nirvash/archetype"
. "nilfm.cc/git/nirvash/lfo" . "hacklab.nilfm.cc/nirvash/lfo"
"nilfm.cc/git/quartzgun/indentalUserDB" "hacklab.nilfm.cc/quartzgun/indentalUserDB"
. "nilfm.cc/git/quartzgun/middleware" . "hacklab.nilfm.cc/quartzgun/middleware"
"nilfm.cc/git/quartzgun/renderer" "hacklab.nilfm.cc/quartzgun/renderer"
"nilfm.cc/git/quartzgun/router" "hacklab.nilfm.cc/quartzgun/router"
"os" "os"
"path/filepath" "path/filepath"
) )

View file

@ -165,6 +165,8 @@ a:hover {
transition: background 1s, color 1s; transition: background 1s, color 1s;
display: inline-block; display: inline-block;
margin-bottom: 0.2em; margin-bottom: 0.2em;
-webkit-appearance: none;
-moz-appearance: none;
} }
.new-page-button:hover { .new-page-button:hover {

View file

@ -9,7 +9,8 @@
<input hidden type="text" name="csrfToken" value="{{$csrfToken}}"/> <input hidden type="text" name="csrfToken" value="{{$csrfToken}}"/>
{{ range $opt, $val := $config }} {{ range $opt, $val := $config }}
{{ if eq ($opt).Type "bool" }} {{ if eq ($opt).Type "bool" }}
<label>{{($opt).Name}} <input type="checkbox" name="{{($opt).Name}}:{{($opt).Type}}" checked="{{$val}}"/></label><br/> <input type="hidden" name="{{($opt).Name}}:{{($opt).Type}}" value="0"/>
<label> {{($opt).Name}} <input type="checkbox" name="{{($opt).Name}}:{{($opt).Type}}" {{ if ne $val "0" }}checked{{end}} value="1"/></label><br/>
{{ end }} {{ end }}
{{ end }} {{ end }}
{{ range $opt, $val := $config }} {{ range $opt, $val := $config }}