This commit is contained in:
Daylin Morgan 2024-05-23 10:34:57 -05:00
parent cc9cc45067
commit ac339c6987
Signed by: daylin
GPG Key ID: 950D13E9719334AD
2 changed files with 6 additions and 4 deletions

View File

@ -38,7 +38,7 @@ var rootCmd = &cobra.Command{
Use: "oizys",
Short: "nix begat oizys",
PersistentPreRun: func(cmd *cobra.Command, args []string) {
oizys.Update(flake, host, cacheName, verbose)
oizys.Set(flake, host, cacheName, verbose)
oizys.CheckFlake()
},
}

View File

@ -52,7 +52,7 @@ func (o *Oizys) Output() string {
)
}
func (o *Oizys) Update(
func (o *Oizys) Set (
flake, host, cache string,
verbose bool,
) {
@ -81,9 +81,9 @@ func terminalSize() (int, int) {
}
type packages struct {
desc string
names []string
pad int
desc string
}
func parsePackages(lines []string, desc string) *packages {
@ -171,12 +171,14 @@ func (o *Oizys) GitPull() {
os.Exit(1)
}
if cmdOutput, err := o.git("pull").CombinedOutput(); err != nil {
cmdOutput, err = o.git("pull").CombinedOutput()
if err != nil {
showFailedOutput(cmdOutput)
log.Fatal(err)
}
}
func parseDryRun(buf string) (*packages, *packages) {
lines := strings.Split(strings.TrimSpace(buf), "\n")
var parts [2][]string