mirror of
https://github.com/packwiz/packwiz.git
synced 2025-05-01 18:26:31 +02:00
Improve optional stuff, add preserve flag
This commit is contained in:
parent
e3bf7afe33
commit
dc9fd4689f
@ -26,12 +26,13 @@ type Index struct {
|
||||
|
||||
// IndexFile is a file in the index
|
||||
type IndexFile struct {
|
||||
// Files are stored in relative forward-slash format to the index file
|
||||
// Files are stored in forward-slash format relative to the index file
|
||||
File string `toml:"file"`
|
||||
Hash string `toml:"hash"`
|
||||
HashFormat string `toml:"hash-format,omitempty"`
|
||||
Alias string `toml:"alias,omitempty"`
|
||||
MetaFile bool `toml:"metafile,omitempty"` // True when it is a .toml metadata file
|
||||
Preserve bool `toml:"preserve,omitempty"` // Don't overwrite the file when updating
|
||||
fileExistsTemp bool
|
||||
}
|
||||
|
||||
|
@ -16,11 +16,16 @@ type Mod struct {
|
||||
Name string `toml:"name"`
|
||||
FileName string `toml:"filename"`
|
||||
Side string `toml:"side,omitempty"`
|
||||
Optional bool `toml:"optional,omitempty"`
|
||||
Download ModDownload `toml:"download"`
|
||||
// Update is a map of map of stuff, so you can store arbitrary values on string keys to define updating
|
||||
Update map[string]map[string]interface{} `toml:"update"`
|
||||
updateData map[string]interface{}
|
||||
|
||||
Option *struct {
|
||||
Optional bool `toml:"optional"`
|
||||
Description string `toml:"description,omitempty"`
|
||||
Default bool `toml:"default,omitempty"`
|
||||
} `toml:"option,omitempty"`
|
||||
}
|
||||
|
||||
// ModDownload specifies how to download the mod file
|
||||
@ -95,4 +100,4 @@ func (m Mod) GetParsedUpdateData(updaterName string) (interface{}, bool) {
|
||||
// GetFilePath is a clumsy hack that I made because Mod already stores it's path anyway
|
||||
func (m Mod) GetFilePath() string {
|
||||
return m.metaFile
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user