chore: add output path flag and directory creation

Add a new flag `-o` to specify the output path for saving the app. Create the output directory if it doesn't exist. Remove the hardcoded directory creation for the "apps" directory. Update the main function to check if the output path is provided and display an error message if it's not.
This commit is contained in:
2026-03-10 21:11:49 +03:00
parent fb62e0b77d
commit 57f7754353
2 changed files with 10 additions and 2 deletions

View File

@ -223,7 +223,6 @@ func checkVersionInDownloaded(udid, query, version string) bool {
}
func main() {
os.MkdirAll("apps", 0755)
bundleID := flag.String("b", "com.zhiliaoapp.musically", "Bundle ID of the app to download from IPAGo server")
host := flag.String("h", "", "Host IPAGo server")
@ -233,8 +232,17 @@ func main() {
pswd := flag.String("pswd", "", "Password to login to IPAGo server")
query := flag.String("q", "", "Query to search for apps on IPAGo server (example: TikTok)")
limit := flag.Int("l", 1, "Limit of apps to search for on IPAGo server")
outputPath := flag.String("o", "", "Output path to save the app")
flag.Parse()
if *outputPath == "" {
fmt.Println("output path is required")
flag.PrintDefaults()
os.Exit(1)
}
os.MkdirAll(*outputPath, 0755)
if *host == "" {
fmt.Println("host is required")
flag.PrintDefaults()