Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
37787ffe
Commit
37787ffe
authored
Mar 24, 2016
by
David McMahon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add --norecurse bool to allow mungedocs to process kube root.
Run hack/after-build/update-generated-docs.sh on kube root with --norecurse and --skip-munges=unversioned-warning.
parent
56de2d11
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
mungedocs.go
cmd/mungedocs/mungedocs.go
+6
-1
update-generated-docs.sh
hack/after-build/update-generated-docs.sh
+11
-0
No files found.
cmd/mungedocs/mungedocs.go
View file @
37787ffe
...
@@ -35,6 +35,7 @@ const latestReleaseBranch = "release-1.2"
...
@@ -35,6 +35,7 @@ const latestReleaseBranch = "release-1.2"
var
(
var
(
verbose
=
flag
.
Bool
(
"verbose"
,
false
,
"On verification failure, emit pre-munge and post-munge versions."
)
verbose
=
flag
.
Bool
(
"verbose"
,
false
,
"On verification failure, emit pre-munge and post-munge versions."
)
verify
=
flag
.
Bool
(
"verify"
,
false
,
"Exit with status 1 if files would have needed changes but do not change."
)
verify
=
flag
.
Bool
(
"verify"
,
false
,
"Exit with status 1 if files would have needed changes but do not change."
)
norecurse
=
flag
.
Bool
(
"norecurse"
,
false
,
"Only process the files of --root-dir."
)
rootDir
=
flag
.
String
(
"root-dir"
,
""
,
"Root directory containing documents to be processed."
)
rootDir
=
flag
.
String
(
"root-dir"
,
""
,
"Root directory containing documents to be processed."
)
// "repo-root" seems like a dumb name, this is the relative path (from rootDir) to get to the repoRoot
// "repo-root" seems like a dumb name, this is the relative path (from rootDir) to get to the repoRoot
relRoot
=
flag
.
String
(
"repo-root"
,
".."
,
`Appended to --root-dir to get the repository root.
relRoot
=
flag
.
String
(
"repo-root"
,
".."
,
`Appended to --root-dir to get the repository root.
...
@@ -155,6 +156,10 @@ func (f fileProcessor) visit(path string) error {
...
@@ -155,6 +156,10 @@ func (f fileProcessor) visit(path string) error {
func
newWalkFunc
(
fp
*
fileProcessor
,
changesNeeded
*
bool
)
filepath
.
WalkFunc
{
func
newWalkFunc
(
fp
*
fileProcessor
,
changesNeeded
*
bool
)
filepath
.
WalkFunc
{
return
func
(
path
string
,
info
os
.
FileInfo
,
err
error
)
error
{
return
func
(
path
string
,
info
os
.
FileInfo
,
err
error
)
error
{
stat
,
err
:=
os
.
Stat
(
path
)
if
path
!=
*
rootDir
&&
stat
.
IsDir
()
&&
*
norecurse
{
return
filepath
.
SkipDir
}
if
err
:=
fp
.
visit
(
path
);
err
!=
nil
{
if
err
:=
fp
.
visit
(
path
);
err
!=
nil
{
*
changesNeeded
=
true
*
changesNeeded
=
true
if
err
!=
ErrChangesNeeded
{
if
err
!=
ErrChangesNeeded
{
...
@@ -194,7 +199,7 @@ func main() {
...
@@ -194,7 +199,7 @@ func main() {
flag
.
Parse
()
flag
.
Parse
()
if
*
rootDir
==
""
{
if
*
rootDir
==
""
{
fmt
.
Fprintf
(
os
.
Stderr
,
"usage: %s [--
verify] --root-dir
<docs root>
\n
"
,
flag
.
Arg
(
0
))
fmt
.
Fprintf
(
os
.
Stderr
,
"usage: %s [--
help] [--verify] [--norecurse] --root-dir [--skip-munges=<skip list>]
<docs root>
\n
"
,
flag
.
Arg
(
0
))
os
.
Exit
(
1
)
os
.
Exit
(
1
)
}
}
...
...
hack/after-build/update-generated-docs.sh
View file @
37787ffe
...
@@ -58,4 +58,15 @@ elif [[ $ret -gt 1 ]]; then
...
@@ -58,4 +58,15 @@ elif [[ $ret -gt 1 ]]; then
exit
1
exit
1
fi
fi
"
${
mungedocs
}
"
"--skip-munges=unversioned-warning,analytics"
\
"--norecurse"
\
"--root-dir=
${
KUBE_ROOT
}
/"
&&
ret
=
0
||
ret
=
$?
if
[[
$ret
-eq
1
]]
;
then
echo
"
${
KUBE_ROOT
}
/ requires manual changes. See preceding errors."
exit
1
elif
[[
$ret
-gt
1
]]
;
then
echo
"Error running mungedocs."
exit
1
fi
# ex: ts=2 sw=2 et filetype=sh
# ex: ts=2 sw=2 et filetype=sh
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment