Skip to content

Commit

Permalink
Update fix for indexer
Browse files Browse the repository at this point in the history
  • Loading branch information
KamasamaK committed Mar 8, 2024
1 parent 0cab15c commit a3db21f
Showing 1 changed file with 26 additions and 16 deletions.
42 changes: 26 additions & 16 deletions utilities/indexer.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,37 @@
</cftry>
</cfif>
</cfloop>

<cfloop array="#structKeyArray(versions)#" index="v">
<cfset vData = {"name"="ColdFusion #v# New Functions and Tags","type"="listing","description"="List of tags and functions added in ColdFusion #v#", "related"=versions[v]}>
<cfset arraySort(vData.related, "text")>
<cfset fileName = "cf#reReplace(v, "[^0-9]", "", "ALL")#">
<cfset fileWrite("#dataDir#/#fileName#.json", prettyJSON(serializeJSON(vData), "utf-8"))>
<p>Wrote <cfoutput>#fileName#</cfoutput>.json</p>

<cfif !arrayContains(categories, fileName)>
<cfset arrayAppend(categories, fileName)>
</cfif>
</cfloop>

<cfloop array="#structKeyArray(lucee_versions)#" index="v">
<cfset vData = {"name"="Lucee #v# New Functions and Tags","type"="listing","description"="List of tags and functions added in Lucee #v#", "related"=lucee_versions[v]}>
<cfset arraySort(vData.related, "text")>
<cfset fileName = "lucee#reReplace(v, "[^0-9]", "", "ALL")#">
<cfset fileWrite("#dataDir#/#fileName#.json", prettyJSON(serializeJSON(vData), "utf-8"))>
<p>Wrote <cfoutput>#fileName#</cfoutput>.json</p>

<cfif !arrayContains(categories, fileName)>
<cfset arrayAppend(categories, fileName)>
</cfif>
</cfloop>

<cfset arraySort(tags, "text")>
<cfset arraySort(functions, "text")>
<cfset arraySort(guides, "text")>
<cfset arraySort(categories, "text")>
<cfset arraySort(all, "text")>

<cfset index = {"tags"=tags, "functions"=functions,"categories"=categories, "guides"=guides, "components"=["application-cfc"]}>
<cfset fileWrite(dataDir & "/index.json", prettyJSON(serializeJSON(index)), "utf-8")>
<p>Wrote index.json</p>
Expand Down Expand Up @@ -96,22 +122,6 @@
<cfset fileWrite(dataDir & "/guides.json", prettyJSON(serializeJSON(gData), "utf-8"))>
<p>Wrote guides.json</p>

<cfloop array="#structKeyArray(versions)#" index="v">
<cfset vData = {"name"="ColdFusion #v# New Functions and Tags","type"="listing","description"="List of tags and functions added in ColdFusion #v#", "related"=versions[v]}>
<cfset arraySort(vData.related, "text")>
<cfset fileName = "cf#reReplace(v, "[^0-9]", "", "ALL")#.json">
<cfset fileWrite("#dataDir#/#fileName#", prettyJSON(serializeJSON(vData), "utf-8"))>
<p>Wrote <cfoutput>#fileName#</cfoutput></p>
</cfloop>

<cfloop array="#structKeyArray(lucee_versions)#" index="v">
<cfset vData = {"name"="Lucee #v# New Functions and Tags","type"="listing","description"="List of tags and functions added in Lucee #v#", "related"=lucee_versions[v]}>
<cfset arraySort(vData.related, "text")>
<cfset fileName = "lucee#reReplace(v, "[^0-9]", "", "ALL")#.json">
<cfset fileWrite("#dataDir#/#fileName#", prettyJSON(serializeJSON(vData), "utf-8"))>
<p>Wrote <cfoutput>#fileName#</cfoutput></p>
</cfloop>

<cfset applicationStop()>
<p>Stopped application so it can reinit</p>

Expand Down

0 comments on commit a3db21f

Please sign in to comment.