Skip to content

Commit b11fb89

Browse files
committed
Switch to cfg! for now to avoid more import oddity
1 parent e5ac8eb commit b11fb89

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

rye/src/bootstrap.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -209,19 +209,17 @@ pub fn update_core_shims(shims: &Path, this: &Path) -> Result<(), Error> {
209209
// hardlinks and if that fails, we fall back to copying the entire file over. This
210210
// for instance is needed when the rye executable is placed on a different volume
211211
// than ~/.rye/shims
212-
#[cfg(target_os = "linux")]
213-
{
212+
if cfg!(target_os = "linux") {
214213
if fs::hard_link(this, shims.join("python")).is_err() {
215214
fs::copy(this, shims.join("python")).context("tried to copy python shim")?;
216215
}
217216
fs::remove_file(shims.join("python3")).ok();
218217
if fs::hard_link(this, shims.join("python3")).is_err() {
219218
fs::copy(this, shims.join("python2")).context("tried to copy python3 shim")?;
220219
}
221-
}
220+
222221
// on other unices we always use symlinks
223-
#[cfg(not(target_os = "linux"))]
224-
{
222+
} else {
225223
let use_softlinks = !cfg!(target_os = "linux");
226224
fs::remove_file(shims.join("python")).ok();
227225
symlink_file(this, shims.join("python")).context("tried to symlink python shim")?;

0 commit comments

Comments
 (0)