mirror of
https://github.com/daylinmorgan/oizys.git
synced 2024-12-22 10:10:45 -06:00
change oizys update
This commit is contained in:
parent
95281a7753
commit
ff6074ef4b
1 changed files with 14 additions and 9 deletions
|
@ -16,24 +16,29 @@ var updateCmd = &cobra.Command{
|
||||||
Short: "update and run nixos rebuild",
|
Short: "update and run nixos rebuild",
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
run := github.GetLastUpdateRun()
|
run := github.GetLastUpdateRun()
|
||||||
|
md, err := github.GetUpateSummary(run.GetID())
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
fmt.Println(md)
|
||||||
if preview {
|
if preview {
|
||||||
md, err := github.GetUpateSummary(run.GetID())
|
os.Exit(0)
|
||||||
if err != nil {
|
}
|
||||||
log.Fatal(err)
|
if !yes && !ui.Confirm("proceed with system update?") {
|
||||||
}
|
os.Exit(0)
|
||||||
fmt.Println(md)
|
|
||||||
if !ui.Confirm("proceed with system update?") {
|
|
||||||
os.Exit(0)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
oizys.UpdateRepo()
|
oizys.UpdateRepo()
|
||||||
oizys.NixosRebuild("switch")
|
oizys.NixosRebuild("switch")
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
var preview bool
|
var (
|
||||||
|
preview bool
|
||||||
|
yes bool
|
||||||
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
rootCmd.AddCommand(updateCmd)
|
rootCmd.AddCommand(updateCmd)
|
||||||
updateCmd.Flags().BoolVar(&preview, "preview", false, "confirm nix store diff")
|
updateCmd.Flags().BoolVar(&preview, "preview", false, "confirm nix store diff")
|
||||||
|
updateCmd.Flags().BoolVar(&yes, "yes", false, "reply yes to all confirm prompts")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue