This repository has been archived on 2025-08-11. You can view files and clone it, but cannot push or open issues or pull requests.
Files
PKGBUILD/cmd/remote/enable.go
2019-05-12 11:57:53 +02:00

40 lines
683 B
Go

package remote
import (
"log"
"github.com/spf13/cobra"
"github.com/volker-raschek/flucky/pkg/config"
)
var enableRemoteCmd = &cobra.Command{
Use: "enable",
Short: "Enable Remove Server",
Args: cobra.ExactArgs(1),
Example: "flucky remote enable origin",
Run: func(cmd *cobra.Command, args []string) {
// read configuration
fc, err := config.Read(cfg)
if err != nil {
log.Fatalln(err)
}
// enable remote address
err = fc.EnableRemote(args[0])
if err != nil {
log.Fatalln(err)
}
// save new configuration
err = config.Write(fc, cfg)
if err != nil {
log.Fatalln(err)
}
},
}
func init() {
remoteCmd.AddCommand(enableRemoteCmd)
}