Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added dropbox link #120

Merged
merged 3 commits into from
Mar 6, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions crates/repository/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ use spl_network_messages::PlayerNumber;

const CONNECT_TIMEOUT: Duration = Duration::from_secs(5);

// How to obtain:
// Right-click file > Under "general access" give view access to anyone with the link
// After clicking copy link you should get a link in your clipboard like this:
// https://drive.google.com/file/d/1QzK11VjOEOfCrsSLc2uoYO9UCoAZdirI/view?usp=sharing
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The file id
const GOOGLE_DRIVE_FILE_ID: &str = "1QzK11VjOEOfCrsSLc2uoYO9UCoAZdirI";
pub const SDK_VERSION: &str = "5.7.4";

#[derive(Clone)]
Expand Down Expand Up @@ -497,8 +491,8 @@ pub async fn get_image_path(version: &str) -> Result<PathBuf> {
Ok(image_path)
}

async fn download_sdk_from_google_drive(file_id: &str, path: impl AsRef<Path>) -> Result<()> {
let fetch_url = format!("https://drive.google.com/uc?export=download&confirm&id={file_id}");
async fn download_sdk_from_dropbox(path: impl AsRef<Path>) -> Result<()> {
let fetch_url = "https://www.dropbox.com/scl/fi/esp0k9y76xwqfez0sfxvx/HULKs-DNT-OS-toolchain-5.7.1.sh?rlkey=io4od5q1cv59llfyqjr7ijpsc&dl=1";
let response = reqwest::get(fetch_url).await?;

let file_size = response
Expand Down Expand Up @@ -533,7 +527,9 @@ async fn download_sdk(downloads_directory: impl AsRef<Path>, installer_name: &st

let installer_path = downloads_directory.as_ref().join(installer_name);

download_sdk_from_google_drive(GOOGLE_DRIVE_FILE_ID, &installer_path).await?;
// download_sdk_from_google_drive(GOOGLE_DRIVE_FILE_ID, &installer_path).await?;

YukumoHunter marked this conversation as resolved.
Show resolved Hide resolved
download_sdk_from_dropbox(&installer_path).await?;

set_permissions(&installer_path, Permissions::from_mode(0o755))
.await
Expand Down
Loading