Remove pack-root, fix serve command (fixes #39)

index.toml is now the pack root - if you want to replicate
what the pack-root option would have provided, just move
your index.toml (and update the path in pack.toml)
This commit is contained in:
comp500
2021-06-13 19:15:33 +01:00
parent 8cbe7d4c61
commit 76460c5414
3 changed files with 22 additions and 17 deletions

View File

@@ -166,11 +166,7 @@ func (in *Index) updateFile(path string) error {
}
func (in Index) GetPackRoot() string {
packRoot := viper.GetString("pack-root")
if len(packRoot) == 0 {
packRoot = filepath.Dir(in.indexFile)
}
return packRoot
return filepath.Dir(in.indexFile)
}
// Refresh updates the hashes of all the files in the index, and adds new files to the index