Skip to content

Commit 2105171

Browse files
committed
pantry.tgz url should base on $PKGX_DIST_URL
1 parent e681f59 commit 2105171

File tree

5 files changed

+14
-9
lines changed

5 files changed

+14
-9
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "pkgx"
33
description = "Run anything"
44
authors = ["Max Howell <[email protected]>", "Jacob Heider <[email protected]>"]
55
license = "Apache-2.0"
6-
version = "2.3.1"
6+
version = "2.3.2"
77
edition = "2021"
88
repository = "https://github.com/pkgxdev/pkgx"
99

crates/lib/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "libpkgx"
33
description = "Install and run `pkgx` packages"
44
authors = ["Max Howell <[email protected]>", "Jacob Heider <[email protected]>"]
55
license = "Apache-2.0"
6-
version = "0.3.2"
6+
version = "0.3.3"
77
edition = "2021"
88
repository = "https://github.com/pkgxdev/pkgx"
99

crates/lib/build.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
fn main() {
22
let dist_url = option_env!("PKGX_DIST_URL").unwrap_or("https://dist.tea.xyz");
3-
let default_pantry_url = format!("{dist_url}/pantry.tgz");
4-
let pantry_url = option_env!("PKGX_PANTRY_TARBALL_URL").unwrap_or(&default_pantry_url);
3+
let default_pantry_tarball_filename = "pantry.tgz";
4+
let pantry_url =
5+
option_env!("PKGX_PANTRY_TARBALL_FILENAME").unwrap_or(default_pantry_tarball_filename);
56

67
println!("cargo:rustc-env=PKGX_DIST_URL={dist_url}");
7-
println!("cargo:rustc-env=PKGX_PANTRY_TARBALL_URL={pantry_url}");
8+
println!("cargo:rustc-env=PKGX_PANTRY_TARBALL_FILENAME={pantry_url}");
89
}

crates/lib/src/sync.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ pub async fn update(config: &Config, conn: &mut Connection) -> Result<(), Box<dy
4747
}
4848

4949
async fn replace(config: &Config, conn: &mut Connection) -> Result<(), Box<dyn Error>> {
50-
let url = env!("PKGX_PANTRY_TARBALL_URL");
50+
let url = format!(
51+
"{}/{}",
52+
config.dist_url,
53+
env!("PKGX_PANTRY_TARBALL_FILENAME")
54+
);
5155
let dest = &config.pantry_dir;
5256

5357
std::fs::create_dir_all(dest)?;
@@ -56,7 +60,7 @@ async fn replace(config: &Config, conn: &mut Connection) -> Result<(), Box<dyn E
5660
.open(dest)?;
5761
dir.lock_exclusive()?;
5862

59-
download_and_extract_pantry(url, dest).await?;
63+
download_and_extract_pantry(&url, dest).await?;
6064

6165
pantry_db::cache(config, conn)?;
6266

0 commit comments

Comments
 (0)