We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8c595fd commit 5aad810Copy full SHA for 5aad810
1 file changed
crates/lib/build.rs
@@ -1,8 +1,14 @@
1
+use std::env;
2
+
3
fn main() {
- #[cfg(unix)]
- let dist_url = option_env!("PKGX_DIST_URL").unwrap_or("https://dist.pkgx.dev");
4
- #[cfg(windows)]
5
- let dist_url = option_env!("PKGX_DIST_URL").unwrap_or("https://dist.pkgx.dev/v2");
+ let target_os = env::var("CARGO_CFG_TARGET_OS").unwrap();
6
+ let dist_url = if target_os == "windows" {
7
+ option_env!("PKGX_DIST_URL").unwrap_or("https://dist.pkgx.dev/v2")
8
+ } else {
9
+ option_env!("PKGX_DIST_URL").unwrap_or("https://dist.pkgx.dev")
10
+ };
11
12
let default_pantry_tarball_filename = "pantry.tgz";
13
let pantry_url =
14
option_env!("PKGX_PANTRY_TARBALL_FILENAME").unwrap_or(default_pantry_tarball_filename);
0 commit comments