| 1 |
# Test the hugo mod init command. |
| 2 |
|
| 3 |
hugo mod init testsubmod |
| 4 |
cmpenv go.mod $WORK/golden/go.mod.testsubmod |
| 5 |
|
| 6 |
# Output formats not yet available at init time must not block hugo mod init. |
| 7 |
# See issue 15253. |
| 8 |
cp hugo2.toml hugo.toml |
| 9 |
rm go.mod |
| 10 |
hugo mod init testsubmod |
| 11 |
cmpenv go.mod $WORK/golden/go.mod.testsubmod |
| 12 |
|
| 13 |
cp hugo3.toml hugo.toml |
| 14 |
rm go.mod |
| 15 |
hugo mod init testsubmod |
| 16 |
cmpenv go.mod $WORK/golden/go.mod.testsubmod |
| 17 |
|
| 18 |
-- hugo.toml -- |
| 19 |
title = "Hugo Modules Test" |
| 20 |
[module] |
| 21 |
[[module.imports]] |
| 22 |
path="github.com/bep/empty-hugo-module" |
| 23 |
-- hugo2.toml -- |
| 24 |
title = "Hugo Modules Test" |
| 25 |
[outputs] |
| 26 |
section = ['HTML', 'print'] |
| 27 |
[module] |
| 28 |
[[module.imports]] |
| 29 |
path="github.com/bep/empty-hugo-module" |
| 30 |
-- hugo3.toml -- |
| 31 |
title = "Hugo Modules Test" |
| 32 |
defaultOutputFormat = 'print' |
| 33 |
[module] |
| 34 |
[[module.imports]] |
| 35 |
path="github.com/bep/empty-hugo-module" |
| 36 |
-- golden/go.mod.testsubmod -- |
| 37 |
module testsubmod |
| 38 |
|
| 39 |
go ${GOMODVERSION} |