|
2 | 2 | ⍝ Open a Cider project.\\ |
3 | 3 | ⍝ `y` must be one of: |
4 | 4 | ⍝ * a namespace holding all required parameters. Such a namespace can be created by calling `CreateOpenParms` |
5 | | -⍝ * A character vector holding the full path to a project |
| 5 | +⍝ * A character vector holding the full path to a project\\ |
| 6 | +⍝ The function returns either FAILURE or SUCCESS. This refers to the principal operation: opening the project. |
| 7 | +⍝ However, if something like loading dependencies goes wrong then messages are printed to the session.\\ |
| 8 | +⍝ In case `batch` is 1 things are different, however: in that case an error is thrown for all essential parts |
| 9 | +⍝ of the operation. That includes loading any dependencies but excludes non-essential stuff like a Git status report. |
6 | 10 | successFlag←FAILURE ⋄ ∆LOG←'' |
7 | 11 | :If 80=⎕DR y |
8 | 12 | parms←CreateOpenParms'' |
|
68 | 72 | :If parms.importFlag |
69 | 73 | res←linkOptions ⎕SE.Link.Import projectSpace_ source ⍝ Get the code into the WS |
70 | 74 | dmx←⎕DMX |
71 | | - ('LINK failed to import the code (,',dmx.EM,')')⎕SIGNAL dmx.EN/⍨∨/'Error:'⍷res |
| 75 | + ('LINK failed to import the code (,',dmx.EM,')')Assert~∨/'Error:'⍷res |
72 | 76 | p'Code imported' |
73 | 77 | :Else |
74 | 78 | res←linkOptions ⎕SE.Link.Create projectSpace_ source ⍝ Get the code into the WS |
75 | 79 | dmx←⎕DMX |
76 | | - ('LINK failed to load the code (',dmx.EM,')')⎕SIGNAL dmx.EN/⍨∨/'Error:'⍷res |
| 80 | + ('LINK failed to load the code (',dmx.EM,')')Assert~∨/'Error:'⍷res |
77 | 81 | :If ∨/'ERRORS ENCOUNTERED:'⍷res |
| 82 | + res Assert 0=parms.batch |
78 | 83 | (1 parms.batch)p res |
79 | 84 | :EndIf |
80 | 85 | (1 parms.batch)p ReportLinkSettings config |
|
91 | 96 | buff←'' |
92 | 97 | buff,←⊂'ERROR: Checking Tatin package status in ',parms.folder |
93 | 98 | buff,←⊂' failed: ',{(1⊃⍵),' in ',{⍵↑⍨⍵⍳']'}(2⊃⍵)}qdmx.DM |
| 99 | + buff Assert 0=parms.batch |
94 | 100 | (1 parms.batch)p buff |
95 | 101 | :EndTrap |
96 | 102 | :EndIf |
97 | 103 | :Trap 0 |
98 | 104 | :If 0=parms.(verbose batch)LoadTatinDependencies config parms.folder(⍕projectSpace_) |
99 | | - (1 parms.batch)p'Package folder ',parms.folder,' needs attention!' |
| 105 | + buff←'Package folder ',parms.folder,' needs attention!' |
| 106 | + buff Assert 0=parms.batch |
| 107 | + 1 p buff |
100 | 108 | :EndIf |
101 | 109 | :Else |
102 | 110 | ⎕SE._Tatin.Client.CloseConnections 1 ⍝ Just in case... |
103 | 111 | qdmx←⎕DMX |
104 | 112 | buff←'' |
105 | 113 | buff,←⊂'ERROR: loading Tatin packages from ',parms.folder |
106 | 114 | buff,←⊂' failed: ',{(1⊃⍵),' in ',{⍵↑⍨⍵⍳']'}(2⊃⍵)}qdmx.DM |
| 115 | + buff←1↓⊃,/(⎕UCS 13),¨buff |
| 116 | + buff Assert 0=parms.batch |
107 | 117 | (1 parms.batch)p buff |
108 | 118 | :EndTrap |
109 | 119 | :EndIf |
|
117 | 127 | buff←'' |
118 | 128 | buff,←⊂'ERROR: loading NuGet packages from ',parms.folder |
119 | 129 | buff,←⊂' failed: ',{(1⊃⍵),' in ',{⍵↑⍨⍵⍳']'}(2⊃⍵)}qdmx.DM |
| 130 | + buff Assert 0=parms.batch |
120 | 131 | (1 parms.batch)p buff |
121 | 132 | :EndTrap |
122 | 133 | :EndIf |
|
0 commit comments