mirror of
https://github.com/daylinmorgan/oizys.git
synced 2024-12-22 14:20:44 -06:00
correct column generator
This commit is contained in:
parent
2c6a0ca733
commit
7e15843425
1 changed files with 6 additions and 6 deletions
|
@ -117,7 +117,7 @@ func ellipsis(s string, maxLen int) string {
|
||||||
|
|
||||||
func (p *packages) show(verbose bool) {
|
func (p *packages) show(verbose bool) {
|
||||||
p.summary()
|
p.summary()
|
||||||
if !verbose {
|
if !verbose || (len(p.names) == 0) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -127,7 +127,7 @@ func (p *packages) show(verbose bool) {
|
||||||
fmt.Printf("%s\n", strings.Repeat("-", w))
|
fmt.Printf("%s\n", strings.Repeat("-", w))
|
||||||
for i, pkg := range pkgs {
|
for i, pkg := range pkgs {
|
||||||
fmt.Printf("%-*s", p.pad, pkg)
|
fmt.Printf("%-*s", p.pad, pkg)
|
||||||
if i%nCols == 0 {
|
if (i+1)%nCols == 0 {
|
||||||
fmt.Println()
|
fmt.Println()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -189,17 +189,18 @@ func parseDryRun(buf string) (*packages, *packages) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(parts[0]) + len(parts[1]) == 0 {
|
if len(parts[0])+len(parts[1]) == 0 {
|
||||||
log.Println("no changes...")
|
log.Println("no changes...")
|
||||||
log.Println("or I failed to parse it into the expected number of parts")
|
log.Println("or I failed to parse it into the expected number of parts")
|
||||||
log.Fatalln("failed to parse nix build --dry-run output")
|
log.Fatalln("failed to parse nix build --dry-run output")
|
||||||
}
|
}
|
||||||
|
|
||||||
return parsePackages(parts[0], "packages to build"), parsePackages(parts[1], "packages to fetch")
|
return parsePackages(parts[0], "packages to build"),
|
||||||
|
parsePackages(parts[1], "packages to fetch")
|
||||||
}
|
}
|
||||||
|
|
||||||
func showDryRunResult(nixOutput string, verbose bool) {
|
func showDryRunResult(nixOutput string, verbose bool) {
|
||||||
toBuild, toFetch := parseDryRun(nixOutput)
|
toBuild, toFetch := parseDryRun(nixOutput)
|
||||||
toBuild.show(verbose)
|
toBuild.show(verbose)
|
||||||
toFetch.show(verbose)
|
toFetch.show(verbose)
|
||||||
}
|
}
|
||||||
|
@ -258,7 +259,6 @@ func (o *Oizys) CacheBuild(rest ...string) {
|
||||||
runCommand(cmd)
|
runCommand(cmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func (o *Oizys) CheckFlake() {
|
func (o *Oizys) CheckFlake() {
|
||||||
if _, err := os.Stat(o.flake); errors.Is(err, fs.ErrNotExist) {
|
if _, err := os.Stat(o.flake); errors.Is(err, fs.ErrNotExist) {
|
||||||
log.Fatalln("path to flake:", o.flake, "does not exist")
|
log.Fatalln("path to flake:", o.flake, "does not exist")
|
||||||
|
|
Loading…
Reference in a new issue