mirror of
https://github.com/StikDebug/StikDebug.git
synced 2026-10-16 04:20:30 +00:00
no need for version.txt
This commit is contained in:
parent
9ca4639661
commit
08d911c5dd
1 changed files with 4 additions and 24 deletions
|
|
@ -49,31 +49,11 @@ func httpGet(_ urlString: String, result: @escaping (String?) -> Void){
|
|||
}
|
||||
|
||||
func UpdateRetrieval() -> Bool{
|
||||
let fileURL = URL.documentsDirectory.appendingPathComponent("version.txt")
|
||||
if !fileManager.fileExists(atPath: fileURL.path) {
|
||||
|
||||
let urlString = "https://raw.githubusercontent.com/0-Blu/StikJIT/refs/heads/main/version.txt"
|
||||
var FileContent: String = "";
|
||||
|
||||
httpGet(urlString) { result in
|
||||
if let fc = result {
|
||||
FileContent = fc
|
||||
}
|
||||
|
||||
}
|
||||
if (FileContent == ""){
|
||||
do {
|
||||
try FileContent.write(to: fileURL, atomically: true, encoding: .utf8)
|
||||
|
||||
print("Wrote to file successfully")
|
||||
} catch {
|
||||
print("Error writing to file: \(error)")
|
||||
}
|
||||
} else {
|
||||
print("Failed to get version.txt, will try again later.")
|
||||
}
|
||||
|
||||
let ver: String {
|
||||
let marketingVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "1.0"
|
||||
return marketingVersion
|
||||
}
|
||||
let ver = try! String(contentsOfFile: fileURL.path)
|
||||
let urlString = "https://raw.githubusercontent.com/0-Blu/StikJIT/refs/heads/main/version.txt"
|
||||
var res = false
|
||||
httpGet(urlString) { result in
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue