diff options
author | Bjørn Erik Pedersen <[email protected]> | 2019-07-31 10:31:26 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2019-07-31 12:10:05 +0200 |
commit | d7c233afee6a16b1947f60b7e5450e40612997bb (patch) | |
tree | 91c87d17642655308ab9806e5afcb9b77415541f /hugolib/filesystems/basefs.go | |
parent | 45ee8a7a52213bf394c7f41a72be78084ddc789a (diff) | |
download | hugo-d7c233afee6a16b1947f60b7e5450e40612997bb.tar.gz hugo-d7c233afee6a16b1947f60b7e5450e40612997bb.zip |
commands: Add "hugo config mounts" command
This prints the effective file mounts in a project.
Fixes #6144
Diffstat (limited to 'hugolib/filesystems/basefs.go')
-rw-r--r-- | hugolib/filesystems/basefs.go | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/hugolib/filesystems/basefs.go b/hugolib/filesystems/basefs.go index e550d7f35..2d8f54d65 100644 --- a/hugolib/filesystems/basefs.go +++ b/hugolib/filesystems/basefs.go @@ -452,20 +452,19 @@ func (b *sourceFilesystemsBuilder) createMainOverlayFs(p *paths.Paths) (*filesys // The theme components are ordered from left to right. // We need to revert it to get the - // overlay logic below working as expected, with the project on top (last). - for i, mod := range mods { + // overlay logic below working as expected, with the project on top. + j := 0 + for i := len(mods) - 1; i >= 0; i-- { + mod := mods[i] dir := mod.Dir() - if i < len(mods)-1 { - i = len(mods) - 2 - i - } - isMainProject := mod.Owner() == nil - modsReversed[i] = mountsDescriptor{ + modsReversed[j] = mountsDescriptor{ Module: mod, dir: dir, isMainProject: isMainProject, } + j++ } err := b.createOverlayFs(collector, modsReversed) |