Skip to content

Commit

Permalink
feat: add ipsw
Browse files Browse the repository at this point in the history
  • Loading branch information
brokeyourbike committed Apr 13, 2022
1 parent bf5d798 commit 9c789ff
Show file tree
Hide file tree
Showing 6 changed files with 238 additions and 17 deletions.
25 changes: 25 additions & 0 deletions cmd/get.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package cmd

import (
"github.com/brokeyourbike/macadmin.go/helpers"
"github.com/spf13/cobra"
)

var feedUrl string

var getCmd = &cobra.Command{
Use: "get",
Short: "Parses Apple's feed of macOS IPSWs and lets you download one.",
Long: `Parses Apple's feed of macOS IPSWs and lets you download one.`,
Run: func(cmd *cobra.Command, args []string) {
ipfs, err := helpers.FetchIpswData(feedUrl)

if err != nil {
panic(err)
}
},
}

func init() {
getCmd.Flags().StringVarP(&feedUrl, "feed_url", "f", "https://mesu.apple.com/assets/macos/com_apple_macOSIPSW/com_apple_macOSIPSW.xml", "Url to Apple's feed of macOS IPSWs")
}
22 changes: 5 additions & 17 deletions cmd/root.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/*
Copyright © 2022 NAME HERE <EMAIL ADDRESS>
*/
package cmd

import (
Expand All @@ -10,18 +6,11 @@ import (
"github.com/spf13/cobra"
)



// rootCmd represents the base command when called without any subcommands
var rootCmd = &cobra.Command{
Use: "macadmin.go",
Short: "A brief description of your application",
Long: `A longer description that spans multiple lines and likely contains
examples and usage of using your application. For example:
Cobra is a CLI library for Go that empowers applications.
This application is a tool to generate the needed files
to quickly create a Cobra application.`,
Use: "macadmin",
Short: "A brief description of your application.",
Long: `A brief description of your application.`,
// Uncomment the following line if your bare application
// has an action associated with it:
// Run: func(cmd *cobra.Command, args []string) { },
Expand All @@ -37,6 +26,7 @@ func Execute() {
}

func init() {
rootCmd.AddCommand(getCmd)
// Here you will define your flags and configuration settings.
// Cobra supports persistent flags, which, if defined here,
// will be global for your application.
Expand All @@ -45,7 +35,5 @@ func init() {

// Cobra also supports local flags, which will only run
// when this action is called directly.
rootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
// rootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
}


23 changes: 23 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,29 @@ go 1.17
require github.com/spf13/cobra v1.3.0

require (
github.com/charmbracelet/bubbletea v0.20.0 // indirect
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e // indirect
github.com/containerd/console v1.0.3 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/groob/plist v0.0.0-20220217120414-63fa881b19a5 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/manifoldco/promptui v0.9.0 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/melbahja/got v0.6.1 // indirect
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect
github.com/muesli/ansi v0.0.0-20211031195517-c9f0611b6c70 // indirect
github.com/muesli/reflow v0.3.0 // indirect
github.com/muesli/termenv v0.11.1-0.20220212125758-44cd13922739 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/schollz/progressbar/v3 v3.8.6 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/objx v0.3.0 // indirect
github.com/stretchr/testify v1.7.0 // indirect
golang.org/x/crypto v0.0.0-20220214200702-86341886e292 // indirect
golang.org/x/sys v0.0.0-20220224120231-95c6836cb0e7 // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)
Loading

0 comments on commit 9c789ff

Please sign in to comment.