mirror of
https://github.com/packwiz/packwiz.git
synced 2025-10-14 06:54:32 +02:00
WIP: misc fixes, start updating CF/MR export to use download system
This commit is contained in:
32
cmdshared/downloadutil.go
Normal file
32
cmdshared/downloadutil.go
Normal file
@@ -0,0 +1,32 @@
|
||||
package cmdshared
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/packwiz/packwiz/core"
|
||||
"os"
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
func ListManualDownloads(session core.DownloadSession) {
|
||||
manualDownloads := session.GetManualDownloads()
|
||||
if len(manualDownloads) > 0 {
|
||||
fmt.Printf("Found %v manual downloads; these mods are unable to be downloaded by packwiz (due to API limitations) and must be manually downloaded:\n",
|
||||
len(manualDownloads))
|
||||
for _, dl := range manualDownloads {
|
||||
fmt.Printf("%s (%s) from %s\n", dl.Name, dl.FileName, dl.URL)
|
||||
}
|
||||
cacheDir, err := core.GetPackwizCache()
|
||||
if err != nil {
|
||||
fmt.Printf("Error locating cache folder: %v", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
err = os.MkdirAll(filepath.Join(cacheDir, core.DownloadCacheInFolder), 0755)
|
||||
if err != nil {
|
||||
fmt.Printf("Error creating cache in folder: %v", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
fmt.Printf("Once you have done so, place these files in %s and re-run this command.\n",
|
||||
filepath.Join(cacheDir, core.DownloadCacheInFolder))
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user