Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 4f944ba

Browse files
committed
[[ Bug 21096 ]] Include exension guide folders in packages
1 parent 4f51d9d commit 4f944ba

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

extensions/script-libraries/extension-utils/extension-utils.livecodescript

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -806,8 +806,9 @@ private command __extensionBuildPackage pDetailsA, pFolder, pTargetFolder, pRemo
806806
tSourceFile, tSupportFiles, pFolder, tArchive, \
807807
pDetailsA["module_files"], pDetailsA["icon"], \
808808
pDetailsA["retina_icon"], pDetailsA["guide_file"], \
809-
pDetailsA["api_file"], pDetailsA["resources"], \
810-
pDetailsA["code"], pDetailsA["samples"], pDetailsA["interface"], \
809+
pDetailsA["guide_contents"], pDetailsA["api_file"], \
810+
pDetailsA["resources"], pDetailsA["code"], \
811+
pDetailsA["samples"], pDetailsA["interface"], \
811812
pDetailsA["defaultscript_file"], pDetailsA["editors"]) \
812813
into tError
813814

@@ -841,14 +842,14 @@ end __extensionAddFolder
841842

842843
private function __extensionAddFilesToPackage \
843844
pSource, pSupportFiles, pFolder, pArchive, pModuleFiles, pIcon, \
844-
pRetinaIcon, pGuide, pDocs, pResources, pCode, \
845+
pRetinaIcon, pGuide, pGuideContents, pDocs, pResources, pCode, \
845846
pSamples, pInterfaceFile, pDefaultScript, pEditors
846847

847848
set the itemdelimiter to slash
848849
# Add source into package, if present
849850
if pSource is not empty then
850851
revZipAddItemWithFile pArchive, item -1 of pSource, pSource
851-
852+
852853
if the result begins with "ziperr" then
853854
return "couldn't add source"
854855
end if
@@ -881,7 +882,9 @@ private function __extensionAddFilesToPackage \
881882
end if
882883

883884
# Add user guide
884-
if pGuide is not empty then
885+
if pGuideContents is not empty then
886+
__extensionAddFolder pArchive, pFolder, "docs/guide", pGuideContents
887+
else if pGuide is not empty then
885888
revZipAddItemWithFile pArchive, "docs/guide/guide.md", pGuide
886889
end if
887890
if the result begins with "ziperr" then
@@ -1041,17 +1044,16 @@ function extensionFetchFolderDetails pFolder, pParseManifest
10411044
put empty into tDetailsA["retina_icon"]
10421045
end if
10431046

1044-
local tGuide, tGuideFile
1045-
if there is a file (pFolder & slash & "docs" & slash & "guide" & slash & "guide.md") then
1046-
put pFolder & slash & "docs" & slash & "guide" & slash & "guide.md" into tGuideFile
1047+
local tGuide, tGuideFile, tGuideFolder
1048+
put pFolder & slash & "docs" & slash & "guide" into tGuideFolder
1049+
if there is a file (tGuideFolder & slash & "guide.md") then
1050+
put __extensionListResourcesRecursive(tGuideFolder, "") \
1051+
into tDetailsA["guide_contents"]
1052+
put tGuideFolder & slash & "guide.md" into tDetailsA["guide_file"]
10471053
else if there is a file (pFolder & slash & "guide.md") then
1048-
put pFolder & slash & "guide.md" into tGuideFile
1054+
put pFolder & slash & "guide.md" into tDetailsA["guide_file"]
10491055
end if
10501056

1051-
if tGuideFile is not empty then
1052-
put tGuideFile into tDetailsA["guide_file"]
1053-
end if
1054-
10551057
// AL-2015-02-23: [[ Bug 14552 ]] Find resource folder and return details
10561058
local tResourceFolder, tResources
10571059
put pFolder & slash & "resources" into tResourceFolder
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# [21096] Include all of extension guide folder in packages

0 commit comments

Comments
 (0)