mirror of
https://github.com/pesde-pkg/pesde.git
synced 2024-12-12 11:00:36 +00:00
fix: allow luau packages in exec command
This commit is contained in:
parent
48c5d159b4
commit
b6459623b7
2 changed files with 29 additions and 13 deletions
|
@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
## [Unreleased]
|
||||
### Fixed
|
||||
- Fix `self-upgrade` overwriting its own binary by @daimond113
|
||||
- Allow use of Luau packages in `execute` command by @daimond113
|
||||
|
||||
## [0.5.0-rc.4] - 2024-10-12
|
||||
### Added
|
||||
|
|
|
@ -40,20 +40,35 @@ impl ExecuteCommand {
|
|||
.refresh(&project)
|
||||
.context("failed to refresh source")?;
|
||||
|
||||
let mut results = source
|
||||
.resolve(
|
||||
&PesdeDependencySpecifier {
|
||||
name: self.package.0,
|
||||
version: self.package.1.unwrap_or(VersionReq::STAR),
|
||||
let version_req = self.package.1.unwrap_or(VersionReq::STAR);
|
||||
let Some((version, pkg_ref)) = ('finder: {
|
||||
let specifier = PesdeDependencySpecifier {
|
||||
name: self.package.0.clone(),
|
||||
version: version_req.clone(),
|
||||
index: None,
|
||||
target: None,
|
||||
},
|
||||
&project,
|
||||
TargetKind::Lune,
|
||||
)
|
||||
.context("failed to resolve package")?;
|
||||
};
|
||||
|
||||
let (version, pkg_ref) = results.1.pop_last().context("no package found")?;
|
||||
if let Some(res) = source
|
||||
.resolve(&specifier, &project, TargetKind::Lune)
|
||||
.context("failed to resolve package")?
|
||||
.1
|
||||
.pop_last()
|
||||
{
|
||||
break 'finder Some(res);
|
||||
}
|
||||
|
||||
source
|
||||
.resolve(&specifier, &project, TargetKind::Luau)
|
||||
.context("failed to resolve package")?
|
||||
.1
|
||||
.pop_last()
|
||||
}) else {
|
||||
anyhow::bail!(
|
||||
"no Lune or Luau package could be found for {}@{version_req}",
|
||||
self.package.0,
|
||||
);
|
||||
};
|
||||
|
||||
log::info!("found package {}@{version}", pkg_ref.name);
|
||||
|
||||
|
|
Loading…
Reference in a new issue