update module URL, fix bool config options; v0.5.0
This commit is contained in:
parent
ab1b85079f
commit
ea6a8598d8
8 changed files with 27 additions and 35 deletions
|
@ -2,7 +2,7 @@ package archetype
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"nilfm.cc/git/quartzgun/auth"
|
||||
"hacklab.nilfm.cc/quartzgun/auth"
|
||||
"strings"
|
||||
)
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ package archetype
|
|||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
|
@ -28,6 +29,7 @@ func (self *EurekaAdapter) Init(cfg *Config) {
|
|||
|
||||
err = self.readCfg()
|
||||
if err != nil {
|
||||
fmt.Printf(err.Error())
|
||||
panic("config.h is malformed!")
|
||||
}
|
||||
}
|
||||
|
@ -312,7 +314,10 @@ func (self *EurekaAdapter) readCfg() error {
|
|||
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:]
|
||||
for _, macro := range macros {
|
||||
|
@ -384,6 +389,7 @@ func (self *EurekaAdapter) writeCfg() error {
|
|||
|
||||
defer f.Close()
|
||||
|
||||
f.WriteString("/* clang-format off */\n");
|
||||
for k, v := range self.Config {
|
||||
switch k.Type {
|
||||
case "int":
|
||||
|
@ -407,8 +413,10 @@ func (self *EurekaAdapter) writeCfg() error {
|
|||
v = strings.ReplaceAll(v, "\r", "")
|
||||
f.WriteString("#define " + k.Name + " \"" + v + "\"\n")
|
||||
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
|
||||
}
|
||||
|
|
4
go.mod
4
go.mod
|
@ -1,7 +1,7 @@
|
|||
module nilfm.cc/git/nirvash
|
||||
module hacklab.nilfm.cc/nirvash
|
||||
|
||||
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
|
||||
|
|
23
go.sum
23
go.sum
|
@ -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-20220518034528-6f7dac969898 h1:SLP7Q4Di66FONjDJbCYrCRrh97focO6sLogHO7/g8F0=
|
||||
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/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
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=
|
||||
nilfm.cc/git/quartzgun v0.0.0-20220516042416-1dbca325d20a/go.mod h1:YqXoEQkRNOU1fZXeq5r2kTzvNbaH2VmULRP9an/sBX4=
|
||||
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=
|
||||
hacklab.nilfm.cc/quartzgun v0.3.0 h1:nOTZaKaKv7q+08Y5vghOIYoMO9g+FAYQUyHzcQP6jUU=
|
||||
hacklab.nilfm.cc/quartzgun v0.3.0/go.mod h1:P6qK4HB0CD/xfyRq8wdEGevAPFDDmv0KCaESSvv93LU=
|
||||
|
|
|
@ -3,7 +3,7 @@ package lfo
|
|||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
core "nilfm.cc/git/nirvash/archetype"
|
||||
core "hacklab.nilfm.cc/nirvash/archetype"
|
||||
"strings"
|
||||
)
|
||||
|
||||
|
|
12
nirvash.go
12
nirvash.go
|
@ -3,12 +3,12 @@ package main
|
|||
import (
|
||||
"html/template"
|
||||
"net/http"
|
||||
core "nilfm.cc/git/nirvash/archetype"
|
||||
. "nilfm.cc/git/nirvash/lfo"
|
||||
"nilfm.cc/git/quartzgun/indentalUserDB"
|
||||
. "nilfm.cc/git/quartzgun/middleware"
|
||||
"nilfm.cc/git/quartzgun/renderer"
|
||||
"nilfm.cc/git/quartzgun/router"
|
||||
core "hacklab.nilfm.cc/nirvash/archetype"
|
||||
. "hacklab.nilfm.cc/nirvash/lfo"
|
||||
"hacklab.nilfm.cc/quartzgun/indentalUserDB"
|
||||
. "hacklab.nilfm.cc/quartzgun/middleware"
|
||||
"hacklab.nilfm.cc/quartzgun/renderer"
|
||||
"hacklab.nilfm.cc/quartzgun/router"
|
||||
"os"
|
||||
"path/filepath"
|
||||
)
|
||||
|
|
|
@ -165,6 +165,8 @@ a:hover {
|
|||
transition: background 1s, color 1s;
|
||||
display: inline-block;
|
||||
margin-bottom: 0.2em;
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
}
|
||||
|
||||
.new-page-button:hover {
|
||||
|
@ -379,4 +381,4 @@ input[type="file"]:valid + .file-feedback::after {
|
|||
body {
|
||||
font-size: 75%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,8 @@
|
|||
<input hidden type="text" name="csrfToken" value="{{$csrfToken}}"/>
|
||||
{{ range $opt, $val := $config }}
|
||||
{{ 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 }}
|
||||
{{ range $opt, $val := $config }}
|
||||
|
|
Loading…
Reference in a new issue