Skip to content

Commit

Permalink
Feature/den2 (#60)
Browse files Browse the repository at this point in the history
* Make PowerShell also fetch directly from blob

Yes yes I know I know

* Fix version parsing for deno
  • Loading branch information
eirikb authored Jul 24, 2023
1 parent c959d98 commit 209c94f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/stage2/stage2.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if ($hash)
{
"$arch-windows" | Out-File .cache\gg\gg-VERVER\system -Encoding ascii
$hash = $hash.split("=")[1]
Invoke-WebRequest "https://gg.eirikb.no/$hash" -OutFile $stage4
Invoke-WebRequest "https://ggcmd.z13.web.core.windows.net/$hash" -OutFile $stage4
if (Test-Path $stage4)
{
$proc = Start-Process $stage4 -WorkingDirectory "$( Get-Location )" -PassThru -NoNewWindow -ErrorAction SilentlyContinue -ArgumentList $args
Expand Down
2 changes: 2 additions & 0 deletions src/stage4/src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ impl GgVersion {
}

pub fn new(version: &str) -> Option<Self> {
let version = version.replace("v", "");
let version = version.as_str();
return if Version::parse(version).is_ok() {
Some(Self(version.to_string()))
} else {
Expand Down
9 changes: 4 additions & 5 deletions src/stage4/src/executors/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,17 +140,16 @@ async fn download_urls(host: &str, target: &Target) -> Vec<Download> {
file.to_string() + ".tar.gz"
}.replace("osx", "darwin").replace("-tar", "");

let version = r.clone().version;
let tags: HashSet<String> = if lts {
["lts".to_string()].iter().cloned().collect()
} else {
HashSet::new()
};
let string = version.replace("v", "");
let result = GgVersion::new(string.as_str());
let version_string = r.version.as_str();
let version = GgVersion::new(version_string);
return Download {
download_url: format!("https://{host}/download/release/{version}/node-{version}-{file_fix}"),
version: result,
download_url: format!("https://{host}/download/release/{version_string}/node-{version_string}-{file_fix}"),
version,
tags,
// Arch and Os are mapped by target Arch/Os
arch: Some(Arch::Any),
Expand Down

0 comments on commit 209c94f

Please sign in to comment.