mirror of
https://github.com/packwiz/packwiz.git
synced 2025-04-19 21:16:30 +02:00
github: Properly handle writing to pack index
Signed-off-by: unilock <unilock@fennet.rentals>
This commit is contained in:
parent
d7fd884f48
commit
e5d1d9d383
@ -54,7 +54,11 @@ var installCmd = &cobra.Command{
|
|||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
installMod(repo, pack)
|
err = installMod(repo, pack)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Printf("Failed to add project: %s\n", err)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,5 +172,25 @@ func installRelease(repo Repo, release Release, pack core.Pack) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return index.RefreshFileWithHash(path, format, hash, true)
|
|
||||||
|
err = index.RefreshFileWithHash(path, format, hash, true)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
err = index.Write()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
err = pack.UpdateIndexHash()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
err = pack.Write()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Printf("Project \"%s\" successfully added! (%s)\n", repo.Name, file.Name)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user