Skip to content

Commit c459bd6

Browse files
committed
[validate.go, config.go] Update nixio validator usage
Closes #81 The executable is now called wit "validate" argument instead of to be a part of a command
1 parent 5683eb9 commit c459bd6

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

internal/config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ var defaultCfg = ServerCfg{
7272
},
7373
Executables{
7474
BIDS: "bids-validator",
75-
NIX: "nixio-validate",
75+
NIX: "nixio",
7676
ODML: "odml-validate",
7777
},
7878
Directories{

internal/web/validate.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ func validateNIX(valroot, resdir string) error {
173173

174174
// TODO: Allow validator config that specifies file paths to validate
175175
// For now we validate everything
176-
nixfiles := make([]string, 0)
176+
nixargs := make([]string, 0)
177+
nixargs = append(nixargs, "validate")
177178
// Find all NIX files (.nix) in the repository
178179
nixfinder := func(path string, info os.FileInfo, err error) error {
179180
if err != nil {
@@ -187,7 +188,7 @@ func validateNIX(valroot, resdir string) error {
187188
}
188189

189190
if strings.ToLower(filepath.Ext(path)) == ".nix" {
190-
nixfiles = append(nixfiles, path)
191+
nixargs = append(nixargs, path)
191192
}
192193
return nil
193194
}
@@ -202,7 +203,7 @@ func validateNIX(valroot, resdir string) error {
202203
outBadge := filepath.Join(resdir, srvcfg.Label.ResultsBadge)
203204

204205
var out, serr bytes.Buffer
205-
cmd := exec.Command(srvcfg.Exec.NIX, nixfiles...)
206+
cmd := exec.Command(srvcfg.Exec.NIX, nixargs...)
206207
out.Reset()
207208
serr.Reset()
208209
cmd.Stdout = &out

0 commit comments

Comments
 (0)