summaryrefslogtreecommitdiffstats
path: root/testscripts/commands/mod.txt
blob: a2ea0ad24d1e91991b46ae99be83081b77c3fe48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Test the hugo mod commands.

dostounix golden/vendor.txt
dostounix golden/go.mod.testsubmod

hugo mod graph
stdout 'empty-hugo'
hugo mod verify
! stderr .
hugo mod get -u
! stderr .
hugo mod get -u ./...
! stderr .
hugo mod vendor
! stderr .
cmp _vendor/modules.txt golden/vendor.txt
hugo mod clean
! stderr .
stdout 'hugo: removed 1 dirs in module cache for \"github.com/bep/empty-hugo-module\"'
hugo mod clean --all
stdout 'Deleted 2\d{2} files from module cache\.'
cd submod
hugo mod init testsubmod
cmpenv go.mod $WORK/golden/go.mod.testsubmod
-- hugo.toml --
title = "Hugo Modules Test"
[module]
[[module.imports]]
path="github.com/bep/empty-hugo-module"
[[module.imports.mounts]]
source="README.md"
target="content/_index.md"
-- go.mod --
go 1.19

module github.com/gohugoio/testmod
-- submod/hugo.toml --
title = "Hugo Sub Module"
-- golden/vendor.txt --
# github.com/bep/empty-hugo-module v1.0.0
-- golden/go.mod.testsubmod --
module testsubmod

go ${GOVERSION}