@@ -132,7 +132,7 @@ command revSaveAsEmscriptenStandalone pStack, pOutputFolder
132132 put tBuildFolder & slash & tName & ".html" into tHtmlFile
133133 logDebug "html" , "Creating" && tHtmlFile
134134 logDebug "html" , "Copying" && getHtmlTemplateFile()
135- revSBCopyFileToFile mapPath (getHtmlTemplateFile()), tHtmlFile , \
135+ revSBCopyFileToFile mapBinPath (getHtmlTemplateFile()), tHtmlFile , \
136136 "revStandaloneProgressCallback" , the long id of me
137137
138138 catch tError
@@ -161,9 +161,9 @@ end revSaveAsEmscriptenStandalone
161161-- File & path helper functions
162162-- --------------------------------------------------------------
163163
164- -- Map a file path into an absolute filesystem path. This is used to
165- -- cope with running from a git repository working tree.
166- private function mapPath pPath
164+ -- Map a compiled file's path into an absolute filesystem path. This
165+ -- is used to cope with running from a git repository working tree.
166+ private function mapBinPath pPath
167167 if there is a file pPath then
168168 return pPath
169169 end if
@@ -175,18 +175,32 @@ private function mapPath pPath
175175 -- We're running from a git checkout
176176 return getRepoBinariesFolder() & slash & pPath
177177 end if
178- end mapPath
178+ end mapBinPath
179+
180+ -- Map a resource file's path into an absolute filesystem path. This
181+ -- is used to cope with running from a git repository working tree.
182+ private function mapResPath pPath
183+ if there is a file pPath then
184+ return pPath
185+ end if
186+
187+ if revEnvironmentIsInstalled() then
188+ return getRuntimeFolder() & slash & pPath
189+ else
190+ return getRepoResourceFolder() & slash & pPath
191+ end if
192+ end mapResPath
179193
180194-- Return a number-indexed array of engine files that need to be
181195-- copied into the standalone output folder.
182196private function getEngineFiles
183197 local tFiles
184198
185199 -- Engine JavaScript
186- put mapPath ("standalone-" & revLicenseType() & "-" & the version & ".js" ) into tFiles [1 ]
200+ put mapBinPath ("standalone-" & revLicenseType() & "-" & the version & ".js" ) into tFiles [1 ]
187201
188202 -- Memory initialisation file
189- put mapPath ("standalone-" & revLicenseType() & "-" & the version & ".html.mem" ) into tFiles [2 ]
203+ put mapBinPath ("standalone-" & revLicenseType() & "-" & the version & ".html.mem" ) into tFiles [2 ]
190204
191205 return tFiles
192206end getEngineFiles
@@ -196,7 +210,7 @@ end getEngineFiles
196210-- initialisation data that's automatically included in all
197211-- standalones (especially fonts).
198212private function getStandaloneTemplateFolder
199- return mapPath ("emscripten-standalone-template" )
213+ return mapResPath ("emscripten-standalone-template" )
200214end getStandaloneTemplateFolder
201215
202216-- Return a number-indexed array of files in the Emscripten standalone
@@ -230,6 +244,11 @@ private command getStandaloneTemplateFiles_Impl @xCount, @xFiles, pRelPath
230244
231245 -- List files
232246 repeat for each line tFile in the files
247+ -- Skip dotfiles
248+ if tFile begins with "." then
249+ next repeat
250+ end if
251+
233252 add 1 to xCount
234253 put pRelPath & slash & tFile into tFilePath
235254 put tFilePath into xFiles[xCount]
@@ -256,7 +275,7 @@ end getStandaloneTemplateFiles_Impl
256275-- This has some standalone-dependent JavaScript substituted into it
257276-- to instantiate the engine.
258277private function getHtmlTemplateFile
259- return mapPath ("standalone-" & revLicenseType() & "-" & the version & ".html" )
278+ return mapBinPath ("standalone-" & revLicenseType() & "-" & the version & ".html" )
260279end getHtmlTemplateFile
261280
262281-- Get the directory containing the Emscripten runtime
@@ -291,9 +310,7 @@ private function getRepoBinariesFolder
291310 return revEnvironmentRepositoryPath() & slash & "emscripten-bin"
292311end getRepoBinariesFolder
293312
294- -- -------------------------------------
295- -- FIXME REMOVE THESE
296-
297- function revEmscriptenGetRepoBinariesFolder
298- return getRepoBinariesFolder()
299- end revEmscriptenGetRepoBinariesFolder
313+ -- Get the directory where Emscripten resources are kept
314+ private function getRepoResourceFolder
315+ return revEnvironmentRepositoryPath() & slash & "engine" & slash & "rsrc"
316+ end getRepoResourceFolder
0 commit comments