mirror of
https://github.com/packwiz/packwiz.git
synced 2025-04-19 21:16:30 +02:00
Make updateFile public
This commit is contained in:
parent
1a42abc0d6
commit
0d7ff15db7
@ -77,8 +77,8 @@ func (in *Index) resortIndex() {
|
||||
})
|
||||
}
|
||||
|
||||
// updateFile calculates the hash for a given path and updates it in the index
|
||||
func (in *Index) updateFile(path string) error {
|
||||
// UpdateFile calculates the hash for a given path and updates it in the index
|
||||
func (in *Index) UpdateFile(path string) error {
|
||||
f, err := os.Open(path)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -154,6 +154,7 @@ func (in *Index) Refresh() error {
|
||||
// for i := 0; i < runtime.NumCPU(); i++ {}
|
||||
|
||||
// Get fileinfos of pack.toml and index to compare them
|
||||
// Case-sensitivity?
|
||||
pathPF, _ := filepath.Abs(in.flags.PackFile)
|
||||
pathIndex, _ := filepath.Abs(in.indexFile)
|
||||
|
||||
@ -175,7 +176,7 @@ func (in *Index) Refresh() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
return in.updateFile(path)
|
||||
return in.UpdateFile(path)
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
@ -185,7 +186,7 @@ func (in *Index) Refresh() error {
|
||||
i := 0
|
||||
for _, file := range in.Files {
|
||||
if file.fileExistsTemp {
|
||||
// Keep file if it exists (already checked in updateFile)
|
||||
// Keep file if it exists (already checked in UpdateFile)
|
||||
in.Files[i] = file
|
||||
i++
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user