Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

new: Support proto v0.17. #1

Merged
merged 5 commits into from
Sep 9, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
Handle canary.
milesj committed Sep 9, 2023
commit 14d69db56b9f90988fff23d777b47fbcb01a4477
12 changes: 7 additions & 5 deletions src/proto.rs
Original file line number Diff line number Diff line change
@@ -62,16 +62,18 @@ pub fn download_prebuilt(
Json(input): Json<DownloadPrebuiltInput>,
) -> FnResult<Json<DownloadPrebuiltOutput>> {
let env = get_proto_environment()?;
let version = input.context.version;

if version == "canary" {
return err!(PluginError::UnsupportedCanary { tool: NAME.into() }.into());
}

let releases: HashMap<String, HashMap<String, ReleaseEntry>> = fetch_url_with_cache(
"https://raw.githubusercontent.com/moonrepo/python-plugin/master/releases.json",
)?;

let Some(release_triples) = releases.get(&input.context.version) else {
return err!(
"No pre-built available for version {}!",
input.context.version
);
let Some(release_triples) = releases.get(&version) else {
return err!("No pre-built available for version {}!", version);
};

let triple = get_target_triple(&env, NAME)?;
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
source: tests/shims_test.rs
assertion_line: 4
expression: "std::fs::read_to_string(sandbox.path().join(\".proto/bin\").join(if cfg!(windows)\n {\n format!(\"{}.cmd\", \"pip\")\n } else { \"pip\".to_string() })).unwrap()"
---
#!/usr/bin/env bash