Trying to fix windows
This commit is contained in:
@@ -8,19 +8,33 @@ use colored::*;
|
|||||||
|
|
||||||
const ANDROID_SDK_URL_LINUX: &str = "https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip";
|
const ANDROID_SDK_URL_LINUX: &str = "https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip";
|
||||||
const ANDROID_SDK_URL_MAC: &str = "https://dl.google.com/android/repository/commandlinetools-mac-11076708_latest.zip";
|
const ANDROID_SDK_URL_MAC: &str = "https://dl.google.com/android/repository/commandlinetools-mac-11076708_latest.zip";
|
||||||
|
const ANDROID_SDK_URL_WINDOWS: &str = "https://dl.google.com/android/repository/commandlinetools-win-11076708_latest.zip";
|
||||||
|
|
||||||
pub fn install(sdk_path: &Path) -> Result<()> {
|
pub fn install(sdk_path: &Path) -> Result<()> {
|
||||||
|
// Check if SDK exists AND is complete
|
||||||
if sdk_path.exists() {
|
if sdk_path.exists() {
|
||||||
|
match verify(sdk_path) {
|
||||||
|
Ok(_) => {
|
||||||
println!("{} Android SDK already installed at: {}",
|
println!("{} Android SDK already installed at: {}",
|
||||||
"✓".green(),
|
"✓".green(),
|
||||||
sdk_path.display()
|
sdk_path.display()
|
||||||
);
|
);
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
Err(_) => {
|
||||||
|
println!("{} Android SDK found but incomplete, reinstalling...",
|
||||||
|
"⚠".yellow()
|
||||||
|
);
|
||||||
|
// Continue with installation
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
println!("{}", "Installing Android SDK...".bright_yellow());
|
println!("{}", "Installing Android SDK...".bright_yellow());
|
||||||
|
|
||||||
let url = if cfg!(target_os = "macos") {
|
let url = if cfg!(target_os = "windows") {
|
||||||
|
ANDROID_SDK_URL_WINDOWS
|
||||||
|
} else if cfg!(target_os = "macos") {
|
||||||
ANDROID_SDK_URL_MAC
|
ANDROID_SDK_URL_MAC
|
||||||
} else {
|
} else {
|
||||||
ANDROID_SDK_URL_LINUX
|
ANDROID_SDK_URL_LINUX
|
||||||
|
|||||||
Reference in New Issue
Block a user