mirror of
https://github.com/packwiz/packwiz.git
synced 2025-10-24 17:44:32 +02:00
Manually replace FAPI deps with QFAPI/QSL when using Quilt (fixes #212)
This commit is contained in:
@@ -589,3 +589,11 @@ func (m *cfDownloadMetadata) DownloadFile() (io.ReadCloser, error) {
|
||||
}
|
||||
return resp.Body, nil
|
||||
}
|
||||
|
||||
func mapDepOverride(depID uint32, isQuilt bool) uint32 {
|
||||
if isQuilt && depID == 306612 {
|
||||
// Transform FAPI dependencies to QFAPI/QSL dependencies when using Quilt
|
||||
return 634179
|
||||
}
|
||||
return depID
|
||||
}
|
||||
|
||||
@@ -122,11 +122,13 @@ var installCmd = &cobra.Command{
|
||||
}
|
||||
|
||||
if len(fileInfoData.Dependencies) > 0 {
|
||||
isQuilt := slices.Contains(pack.GetLoaders(), "quilt")
|
||||
|
||||
var depsInstallable []installableDep
|
||||
var depIDPendingQueue []uint32
|
||||
for _, dep := range fileInfoData.Dependencies {
|
||||
if dep.Type == dependencyTypeRequired {
|
||||
depIDPendingQueue = append(depIDPendingQueue, dep.ModID)
|
||||
depIDPendingQueue = append(depIDPendingQueue, mapDepOverride(dep.ModID, isQuilt))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -190,7 +192,7 @@ var installCmd = &cobra.Command{
|
||||
|
||||
for _, dep := range depFileInfo.Dependencies {
|
||||
if dep.Type == dependencyTypeRequired {
|
||||
depIDPendingQueue = append(depIDPendingQueue, dep.ModID)
|
||||
depIDPendingQueue = append(depIDPendingQueue, mapDepOverride(dep.ModID, isQuilt))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user