Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for packaging registered files to alternate relative folder #216

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions packager/packager.livecodescript
Original file line number Diff line number Diff line change
Expand Up @@ -1523,7 +1523,22 @@ private command _packageFiles pBuildProfile, pPlatform, @xAppA, pOutputFolder
end if

put xAppA[tLookupA][i]["filename"] into tFilename
replace levureAppFolder() with pOutputFolder in tFilename

# Figure out destination
local tDestination
put xAppA[tLookupA][i]["destination"] into tDestination

if tDestination is empty then
replace levureAppFolder() with pOutputFolder in tFilename
else
put _normalizeRelativeFilename(tDestination) into tDestination
# tDestination may have been `./` or `/`.
if the last char of tDestination is "/" then
delete the last char of tDestination
end if
put tDestination & "/" & the last item of tFilename into tDestination
put pOutputFolder & "/" & tDestination into tFilename
end if

packagerCreateAllFoldersInPath item 1 to -2 of tFilename, pOutputFolder
put _errorMsg("creating folder" && item 1 to -2 of tFilename, the result) into tError
Expand All @@ -1537,7 +1552,12 @@ private command _packageFiles pBuildProfile, pPlatform, @xAppA, pOutputFolder
if tError is empty then
# Create new array with excluded elements removed
add 1 to tIndex
put _makeRelativePath(xAppA[tLookupA][i]["filename"],levureAppFolder()) into tCompsA[tIndex]["filename"]
if tDestination is not empty then
put "./" & tDestination into tCompsA[tIndex]["filename"]
else
put _makeRelativePath(xAppA[tLookupA][i]["filename"],levureAppFolder()) \
into tCompsA[tIndex]["filename"]
end if
repeat for each key tProp in xAppA[tLookupA][i]
if tProp is "filename" then next repeat

Expand Down