@@ -7,6 +7,8 @@ const descriptionStartTag = '<!-- DESCRIPTION:START -->'
77const descriptionEndTag = '<!-- DESCRIPTION:END -->'
88const technicalDetailsStartTag = '<!-- TECHNICAL-DETAILS:START -->'
99const technicalDetailsEndTag = '<!-- TECHNICAL-DETAILS:END -->'
10+ const listStartTag = '<!-- LIST:START -->'
11+ const listEndTag = '<!-- LIST:END -->'
1012
1113// @TODO : Move this function to a shared file
1214const replaceMetadata = ( fileContent , metadata ) => {
@@ -60,4 +62,25 @@ ${technicalDetailsEndTag}
6062 updateContent ( currentFileContent )
6163 }
6264 writeFileSync ( destination , fileContent )
63- } )
65+ } )
66+
67+ // Update the policies list
68+ const policiesList = policies . map ( ( policy ) => {
69+ return `- ${ policy . title } ([${ policy . name } ](/docs/policies/${ policy . name } ))`
70+ } ) . join ( '\n' )
71+
72+ const policiesListContent = `${ listStartTag }
73+ ${ policiesList }
74+ ${ listEndTag } `
75+
76+ const policiesListDestination = path . join ( process . cwd ( ) , 'docs/projects/fortSphere/policies.md' )
77+ policiesListFileContent = readFileSync ( policiesListDestination , 'utf8' )
78+
79+ policiesListFileContent = updateOrCreateSegment ( {
80+ original : policiesListFileContent ,
81+ replacementSegment : policiesListContent ,
82+ startTag : listStartTag ,
83+ endTag : listEndTag
84+ } )
85+
86+ writeFileSync ( policiesListDestination , policiesListFileContent )
0 commit comments