File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 246
246
:If 0 = ⍴⍴ r ⋄ r ← ⊃ r ⋄ :EndIf
247
247
∇
248
248
249
+ ∇ SubstEnv config ;getEnv;subst;n;v
250
+ ⍝ substitute environment variables for items with values im the form $envName$
251
+ ⍝ config is a configuration result from ReadConfiguration
252
+ ⍝ it should be either a namespace reference, or a vector of namespace references
253
+ getEnv ← {2 ⎕NQ ' .' ' GetEnvironment' ⍵ }
254
+ subst ← {
255
+ 0 ∊ ⍴ ⍵ :⍵ ⋄
256
+ ' $' ∧ . = (⊣ / , ⊢ / )(2 ⌈ ≢ ⍵ )↑ ⍵ :getEnv 1 ↓ ¯1 ↓ ⍵ ⋄
257
+ ⍵ }
258
+ :Select ⊃ ⎕NC ' config'
259
+ :Case 2
260
+ :If 9.1 ∧ . = {⎕NC ⊂ , ' ⍵' }¨ config
261
+ SubstEnv ¨ config
262
+ :EndIf
263
+ :Case 9
264
+ :For n :In config . ⎕NL ¯2
265
+ :Select ≡ v ← config ⍎ n
266
+ :Case 1
267
+ v ← subst v
268
+ :Case 2
269
+ v ← subst ¨ v
270
+ :Else
271
+ ∘∘∘
272
+ :EndSelect
273
+ ⍎ ' config.' , n , ' ←v'
274
+ :EndFor
275
+ :EndSelect
276
+ ∇
277
+
249
278
∇ config ← {element} ReadConfiguration type ;serverconfig;file;siteconfig;thing;ind;mask
250
279
⍝ Attempt to read configuration file
251
280
⍝ 1) from server root MSRoot
278
307
config ← serverconfig
279
308
:EndIf
280
309
:EndIf
310
+ :If config ≢ ' ' ⋄ SubstEnv config ⋄ :EndIf
281
311
∇
282
312
283
313
∇ Config ← ConfigureServer AppRoot ;file
You can’t perform that action at this time.
0 commit comments