This repository has been archived by the owner on Mar 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use flakehub for installs, self-manage fleek, autogc (#282)
* feat: use flakehub for installs, self-manage fleek, autogc * fix: doc comments * fix: fmt * fix: fmt * fix: discard error * fix: readme
- Loading branch information
Showing
9 changed files
with
114 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
Copyright © 2023 NAME HERE <EMAIL ADDRESS> | ||
*/ | ||
package fleekcli | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
"github.com/ublue-os/fleek/fin" | ||
"github.com/ublue-os/fleek/internal/flake" | ||
) | ||
|
||
// WriteCommand is an internal hidden command that | ||
// gets run after an update. | ||
func WriteCommand() *cobra.Command { | ||
command := &cobra.Command{ | ||
Hidden: true, | ||
Use: app.Trans("write.use"), | ||
Short: app.Trans("write.short"), | ||
Long: app.Trans("write.long"), | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
return write(cmd) | ||
}, | ||
} | ||
|
||
return command | ||
} | ||
|
||
// writeCmd represents the write command | ||
func write(cmd *cobra.Command) error { | ||
fin.Description.Println(cmd.Short) | ||
err := mustConfig() | ||
if err != nil { | ||
return err | ||
} | ||
fl, err := flake.Load(cfg, app) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
err = fl.Write("flake update", true, false) | ||
if err != nil { | ||
fin.Debug.Printfln("flake write error: %s", err) | ||
return err | ||
} | ||
|
||
fin.Success.Println(app.Trans("write.done")) | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters