From 57f7754353e7d636fb526bb2db6b55b4f7a445ef Mon Sep 17 00:00:00 2001 From: trojvn Date: Tue, 10 Mar 2026 21:11:49 +0300 Subject: [PATCH] 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. --- client/example.sh | 2 +- client/main.go | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/client/example.sh b/client/example.sh index 7ff918e..3e48075 100644 --- a/client/example.sh +++ b/client/example.sh @@ -1,3 +1,3 @@ #!/bin/bash -./IPAGoClient -user mrx.trojan@icloud.com -pswd ... -h 65.109.64.76 -p 9001 -q TikTok -b com.zhiliaoapp.musically -u ... +./IPAGoClient -user mrx.trojan@icloud.com -pswd ... -h 65.109.64.76 -p 9001 -q TikTok -b com.zhiliaoapp.musically -u ... -o /Users/trojvn/Documents/Code/iTikBot/apps/ diff --git a/client/main.go b/client/main.go index f0ba737..00b701a 100644 --- a/client/main.go +++ b/client/main.go @@ -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()