Skip to content

Commit

Permalink
fix: swift path on macos
Browse files Browse the repository at this point in the history
Fixes #3288
  • Loading branch information
jdx committed Nov 29, 2024
1 parent f8fc242 commit 572cb8e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion registry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ bat.backends = ["ubi:sharkdp/bat", "asdf:https://gitlab.com/wt0f/asdf-bat"]
bat-extras.backends = ["asdf:vhdirk/asdf-bat-extras"]
bats.backends = ["aqua:bats-core/bats-core", "asdf:timgluz/asdf-bats"]
bats.os = ["linux", "macos"]
bats.test = ["bats -v", "Bats {{version}}"]
bats.test = ["bats -v", "Bats"]
bazel.backends = ["ubi:bazelbuild/bazel", "asdf:rajatvig/asdf-bazel"]
bazel.test = ["bazel --version", "bazel {{version}}"]
bazelisk.backends = ["aqua:bazelbuild/bazelisk", "asdf:josephtate/asdf-bazelisk"]
Expand Down
7 changes: 2 additions & 5 deletions src/plugins/core/swift.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ impl SwiftPlugin {

fn install(&self, ctx: &InstallContext, tv: &ToolVersion, tarball_path: &Path) -> Result<()> {
let filename = tarball_path.file_name().unwrap().to_string_lossy();
let version = &tv.version;
ctx.pr.set_message(format!("extract {filename}"));
if cfg!(macos) {
let tmp = {
Expand All @@ -77,11 +78,7 @@ impl SwiftPlugin {
.execute()?;
file::remove_all(tv.install_path())?;
file::rename(
tmp.join("pkg")
.join(format!(
"swift-{version}-RELEASE-osx-package.pkg",
version = tv.version
))
tmp.join(format!("swift-{version}-RELEASE-osx-package.pkg"))
.join("Payload"),
tv.install_path(),
)?;
Expand Down

0 comments on commit 572cb8e

Please sign in to comment.