diff options
author | Justin Clark-Casey (justincc) | 2014-07-10 19:40:44 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2014-07-10 19:40:44 +0100 |
commit | 6d3b409af264dc4c9f34b8a4cf2ceb990c141ca5 (patch) | |
tree | 5da84ce8752896a9cd87311bec424f1fa7a30840 /OpenSim/Region/ScriptEngine/Shared/CodeTools | |
parent | Fix bug in "show modules" comamnd that was showing shared modules as non-shar... (diff) | |
download | opensim-SC-6d3b409af264dc4c9f34b8a4cf2ceb990c141ca5.zip opensim-SC-6d3b409af264dc4c9f34b8a4cf2ceb990c141ca5.tar.gz opensim-SC-6d3b409af264dc4c9f34b8a4cf2ceb990c141ca5.tar.bz2 opensim-SC-6d3b409af264dc4c9f34b8a4cf2ceb990c141ca5.tar.xz |
refactor: use existing Compiler.CreateScriptsDirectory() (renamed to CheckOrCreateScriptsDirectory()) when checking that scripts directory exists on compile.
Code was identical apart from error logging, but if there are failures creating these directories then you'll be
seeing lots of errors anyway, and these will be more informative
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/CodeTools')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs | 30 |
1 files changed, 4 insertions, 26 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs index 5988539..f874de2 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs | |||
@@ -120,7 +120,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
120 | if (in_startup) | 120 | if (in_startup) |
121 | { | 121 | { |
122 | in_startup = false; | 122 | in_startup = false; |
123 | CreateScriptsDirectory(); | 123 | CheckOrCreateScriptsDirectory(); |
124 | 124 | ||
125 | // First time we start? Delete old files | 125 | // First time we start? Delete old files |
126 | if (DeleteScriptsOnStartup) | 126 | if (DeleteScriptsOnStartup) |
@@ -189,13 +189,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
189 | } | 189 | } |
190 | 190 | ||
191 | // We now have an allow-list, a mapping list, and a default language | 191 | // We now have an allow-list, a mapping list, and a default language |
192 | |||
193 | } | 192 | } |
194 | 193 | ||
195 | /// <summary> | 194 | /// <summary> |
196 | /// Create the directory where compiled scripts are stored. | 195 | /// Create the directory where compiled scripts are stored if it does not already exist. |
197 | /// </summary> | 196 | /// </summary> |
198 | private void CreateScriptsDirectory() | 197 | private void CheckOrCreateScriptsDirectory() |
199 | { | 198 | { |
200 | if (!Directory.Exists(ScriptEnginesPath)) | 199 | if (!Directory.Exists(ScriptEnginesPath)) |
201 | { | 200 | { |
@@ -302,28 +301,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
302 | 301 | ||
303 | assembly = GetCompilerOutput(asset); | 302 | assembly = GetCompilerOutput(asset); |
304 | 303 | ||
305 | if (!Directory.Exists(ScriptEnginesPath)) | 304 | CheckOrCreateScriptsDirectory(); |
306 | { | ||
307 | try | ||
308 | { | ||
309 | Directory.CreateDirectory(ScriptEnginesPath); | ||
310 | } | ||
311 | catch (Exception) | ||
312 | { | ||
313 | } | ||
314 | } | ||
315 | |||
316 | if (!Directory.Exists(Path.Combine(ScriptEnginesPath, | ||
317 | m_scriptEngine.World.RegionInfo.RegionID.ToString()))) | ||
318 | { | ||
319 | try | ||
320 | { | ||
321 | Directory.CreateDirectory(ScriptEnginesPath); | ||
322 | } | ||
323 | catch (Exception) | ||
324 | { | ||
325 | } | ||
326 | } | ||
327 | 305 | ||
328 | // Don't recompile if we already have it | 306 | // Don't recompile if we already have it |
329 | // Performing 3 file exists tests for every script can still be slow | 307 | // Performing 3 file exists tests for every script can still be slow |