surtur
a2bc1eec6f
All checks were successful
continuous-integration/drone/push Build is passing
also, look for `report.tex` in the new place from now on.
48 lines
832 B
Go
48 lines
832 B
Go
// Copyright 2022 wanderer <a_mirre at utb dot cz>
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
package report
|
|
|
|
//go:generate go run gen.go
|
|
|
|
import (
|
|
"fmt"
|
|
"io"
|
|
"log"
|
|
"os"
|
|
)
|
|
|
|
const (
|
|
outPrefix = "out/"
|
|
texDir = "tex/"
|
|
picsDir = "pics/"
|
|
)
|
|
|
|
// GetPicsDirPrefix returns the path to the folder meant for tex files.
|
|
func GetTexDir() string {
|
|
return outPrefix + texDir
|
|
}
|
|
|
|
// GetPicsDirPrefix returns the path to the folder meant for plot pics.
|
|
func GetPicsDir() string {
|
|
return outPrefix + picsDir
|
|
}
|
|
|
|
// Print prints stats in a report format.
|
|
func Print() {
|
|
fmt.Fprint(os.Stderr, "\n* printing the report...\n\n")
|
|
|
|
// when run from the repo root
|
|
fname := GetTexDir() + "report.tex"
|
|
|
|
fh, err := os.Open(fname)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
|
|
_, err = io.Copy(os.Stdout, fh)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
}
|