-
Notifications
You must be signed in to change notification settings - Fork 1
/
_nvidia_force_install
executable file
·655 lines (540 loc) · 21.9 KB
/
_nvidia_force_install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
#!/usr/bin/env bash
#Universal debugging filesystem.
_user_log_anchor() {
# DANGER Do NOT create automatically, or reference any existing directory!
! [[ -d "$HOME"/.ubcore/userlog ]] && cat - > /dev/null 2>&1 && return 0
#Terminal session may be used - the sessionid may be set through .bashrc/.ubcorerc .
if [[ "$sessionid" != "" ]]
then
cat - >> "$HOME"/.ubcore/userlog/a-"$sessionid".log
return 0
fi
cat - >> "$HOME"/.ubcore/userlog/a-undef.log
return 0
}
#Cyan. Harmless status messages.
_messagePlain_nominal() {
echo -e -n '\E[0;36m '
echo -n "$@"
echo -e -n ' \E[0m'
echo
return 0
}
#Blue. Diagnostic instrumentation.
_messagePlain_probe() {
echo -e -n '\E[0;34m '
echo -n "$@"
echo -e -n ' \E[0m'
echo
return 0
}
#Blue. Diagnostic instrumentation.
_messagePlain_probe_expr() {
echo -e -n '\E[0;34m '
echo -e -n "$@"
echo -e -n ' \E[0m'
echo
return 0
}
#Green. Working as expected.
_messagePlain_good() {
echo -e -n '\E[0;32m '
echo -n "$@"
echo -e -n ' \E[0m'
echo
return 0
}
#Yellow. May or may not be a problem.
_messagePlain_warn() {
echo -e -n '\E[1;33m '
echo -n "$@"
echo -e -n ' \E[0m'
echo
return 0
}
#Red. Will result in missing functionality, reduced performance, etc, but not necessarily program failure overall.
_messagePlain_bad() {
echo -e -n '\E[0;31m '
echo -n "$@"
echo -e -n ' \E[0m'
echo
return 0
}
##Parameters
#"--shell", ""
#"--profile"
#"--parent", "--embed", "--return", "--devenv"
#"--call", "--script" "--bypass"
ub_import=
ub_import_param=
ub_import_script=
ub_loginshell=
[[ "${BASH_SOURCE[0]}" != "${0}" ]] && ub_import="true"
([[ "$1" == '--profile' ]] || [[ "$1" == '--script' ]] || [[ "$1" == '--call' ]] || [[ "$1" == '--return' ]] || [[ "$1" == '--devenv' ]] || [[ "$1" == '--shell' ]] || [[ "$1" == '--bypass' ]] || [[ "$1" == '--parent' ]] || [[ "$1" == '--embed' ]]) && ub_import_param="$1" && shift
([[ "$0" == "/bin/bash" ]] || [[ "$0" == "-bash" ]] || [[ "$0" == "/usr/bin/bash" ]] || [[ "$0" == "bash" ]]) && ub_loginshell="true" #Importing ubiquitous bash into a login shell with "~/.bashrc" is the only known cause for "_getScriptAbsoluteLocation" to return a result such as "/bin/bash".
[[ "$ub_import" == "true" ]] && ! [[ "$ub_loginshell" == "true" ]] && ub_import_script="true"
_messagePlain_probe_expr '$0= '"$0"'\n ''$1= '"$1"'\n ''ub_import= '"$ub_import"'\n ''ub_import_param= '"$ub_import_param"'\n ''ub_import_script= '"$ub_import_script"'\n ''ub_loginshell= '"$ub_loginshell" | _user_log_anchor
# DANGER Prohibited import from login shell. Use _setupUbiquitous, call from another script, or manually set importScriptLocation.
# WARNING Import from shell can be detected. Import from script cannot. Asserting that script has been imported is possible. Asserting that script has not been imported is not possible. Users may be protected from interactive mistakes. Script developers are NOT protected.
if [[ "$ub_import_param" == "--profile" ]]
then
([[ "$profileScriptLocation" == "" ]] || [[ "$profileScriptFolder" == "" ]]) && _messagePlain_bad 'import: profile: missing: profileScriptLocation, missing: profileScriptFolder' | _user_log_anchor && return 1
elif ([[ "$ub_import_param" == "--parent" ]] || [[ "$ub_import_param" == "--embed" ]] || [[ "$ub_import_param" == "--return" ]] || [[ "$ub_import_param" == "--devenv" ]])
then
([[ "$scriptAbsoluteLocation" == "" ]] || [[ "$scriptAbsoluteFolder" == "" ]] || [[ "$sessionid" == "" ]]) && _messagePlain_bad 'import: parent: missing: scriptAbsoluteLocation, missing: scriptAbsoluteFolder, missing: sessionid' | _user_log_anchor && return 1
elif [[ "$ub_import_param" == "--call" ]] || [[ "$ub_import_param" == "--script" ]] || [[ "$ub_import_param" == "--bypass" ]] || [[ "$ub_import_param" == "--shell" ]] || ([[ "$ub_import" == "true" ]] && [[ "$ub_import_param" == "" ]])
then
([[ "$importScriptLocation" == "" ]] || [[ "$importScriptFolder" == "" ]]) && _messagePlain_bad 'import: call: missing: importScriptLocation, missing: importScriptFolder' | _user_log_anchor && return 1
elif [[ "$ub_import" != "true" ]] #"--shell", ""
then
_messagePlain_warn 'import: undetected: cannot determine if imported' | _user_log_anchor
true #no problem
else #FAIL, implies [[ "$ub_import" == "true" ]]
_messagePlain_bad 'import: fall: fail' | _user_log_anchor && return 1
exit 1
fi
if [[ "$ub_import_param" == "--profile" ]]
then
ub_import=true
elif ([[ "$ub_import_param" == "--parent" ]] || [[ "$ub_import_param" == "--embed" ]] || [[ "$ub_import_param" == "--return" ]] || [[ "$ub_import_param" == "--devenv" ]]) && [[ "$scriptAbsoluteLocation" != "" ]] && [[ "$scriptAbsoluteFolder" != "" ]] && [[ "$sessionid" != "" ]]
then
ub_import=true
elif [[ "$ub_import_param" == "--call" ]] || [[ "$ub_import_param" == "--script" ]] || [[ "$ub_import_param" == "--bypass" ]] || [[ "$ub_import_param" == "--shell" ]] || ([[ "$ub_import" == "true" ]] && [[ "$ub_import_param" == "" ]])
then
ub_import=true
fi
[[ "$ub_import" != "true" ]] && ub_import_param=
#Critical prerequsites.
_realpath_L() {
if ! _compat_realpath_run -L . > /dev/null 2>&1
then
readlink -f "$@"
return
fi
realpath -L "$@"
}
_realpath_L_s() {
if ! _compat_realpath_run -L . > /dev/null 2>&1
then
readlink -f "$@"
return
fi
realpath -L -s "$@"
}
_getAbsolute_criticalDep() {
! type realpath > /dev/null 2>&1 && return 1
! type readlink > /dev/null 2>&1 && return 1
! type dirname > /dev/null 2>&1 && return 1
#Known issue on Mac. See https://github.com/mirage335/ubiquitous_bash/issues/1 .
! realpath -L . > /dev/null 2>&1 && return 1
return 0
}
! _getAbsolute_criticalDep && exit 1
#####Utilities.
#Retrieves absolute path of current script, while maintaining symlinks, even when "./" would translate with "readlink -f" into something disregarding symlinked components in $PWD.
#However, will dereference symlinks IF the script location itself is a symlink. This is to allow symlinking to scripts to function normally.
#Suitable for allowing scripts to find other scripts they depend on. May look like an ugly hack, but it has proven reliable over the years.
_getScriptAbsoluteLocation() {
if [[ "$0" == "-"* ]]
then
return 1
fi
local absoluteLocation
if [[ (-e $PWD\/$0) && ($0 != "") ]] && [[ "$0" != "/"* ]]
then
absoluteLocation="$PWD"\/"$0"
absoluteLocation=$(_realpath_L_s "$absoluteLocation")
else
absoluteLocation=$(_realpath_L "$0")
fi
if [[ -h "$absoluteLocation" ]]
then
absoluteLocation=$(readlink -f "$absoluteLocation")
absoluteLocation=$(_realpath_L "$absoluteLocation")
fi
echo $absoluteLocation
}
alias getScriptAbsoluteLocation=_getScriptAbsoluteLocation
#Retrieves absolute path of current script, while maintaining symlinks, even when "./" would translate with "readlink -f" into something disregarding symlinked components in $PWD.
#Suitable for allowing scripts to find other scripts they depend on.
_getScriptAbsoluteFolder() {
if [[ "$0" == "-"* ]]
then
return 1
fi
dirname "$(_getScriptAbsoluteLocation)"
}
alias getScriptAbsoluteFolder=_getScriptAbsoluteFolder
#Retrieves absolute path of parameter, while maintaining symlinks, even when "./" would translate with "readlink -f" into something disregarding symlinked components in $PWD.
#Suitable for finding absolute paths, when it is desirable not to interfere with symlink specified folder structure.
_getAbsoluteLocation() {
if [[ "$1" == "-"* ]]
then
return 1
fi
if [[ "$1" == "" ]]
then
echo
return
fi
local absoluteLocation
if [[ (-e $PWD\/$1) && ($1 != "") ]] && [[ "$1" != "/"* ]]
then
absoluteLocation="$PWD"\/"$1"
absoluteLocation=$(_realpath_L_s "$absoluteLocation")
else
absoluteLocation=$(_realpath_L "$1")
fi
echo "$absoluteLocation"
}
alias getAbsoluteLocation=_getAbsoluteLocation
#https://unix.stackexchange.com/questions/27021/how-to-name-a-file-in-the-deepest-level-of-a-directory-tree?answertab=active#tab-top
_filter_lowestPath() {
awk -F'/' 'NF > depth {
depth = NF;
deepest = $0;
}
END {
print deepest;
}'
}
#https://stackoverflow.com/questions/1086907/can-find-or-any-other-tool-search-for-files-breadth-first
_filter_highestPath() {
awk -F'/' '{print "", NF, $F}' | sort -n | awk '{print $2}' | head -n 1
}
_recursion_guard() {
! [[ -e "$1" ]] && return 1
! [[ -s "$1" ]] && return 1
! head --bytes=1 "$1" > /dev/null 2>&1 && return 1
#! type "$1" >/dev/null 2>&1 && return 1
local launchGuardScriptAbsoluteLocation
launchGuardScriptAbsoluteLocation=$(_getScriptAbsoluteLocation)
local launchGuardTestAbsoluteLocation
launchGuardTestAbsoluteLocation=$(_getAbsoluteLocation "$1")
[[ "$launchGuardScriptAbsoluteLocation" == "$launchGuardTestAbsoluteLocation" ]] && return 1
return 0
}
#Generates random alphanumeric characters, default length 18.
_uid() {
local uidLength
! [[ -z "$1" ]] && uidLength="$1" || uidLength=18
cat /dev/urandom 2> /dev/null | base64 2> /dev/null | tr -dc 'a-zA-Z0-9' 2> /dev/null | head -c "$uidLength" 2> /dev/null
}
#Demarcate major steps.
_messageNormal() {
echo -e -n '\E[1;32;46m '
echo -n "$@"
echo -e -n ' \E[0m'
echo
return 0
}
#Demarcate major failures.
_messageError() {
echo -e -n '\E[1;33;41m '
echo -n "$@"
echo -e -n ' \E[0m'
echo
return 0
}
#https://stackoverflow.com/questions/4210042/how-to-exclude-a-directory-in-find-command/16595367#16595367
_findAnchor() {
local anchorCurrentSearchDir
anchorCurrentSearchDir="$1"
shift
find -P "$anchorCurrentSearchDir" -not \( -path \*.git\* -prune \) -not \( -path \*_arc\* -prune \) -not \( -path \*_buried\* -prune \) -not \( -path \*_lib\* -prune \) -not \( -path \*_local\* -prune \) -not \( -path \*_local/_index\* -prune \) -not \( -path \*_local/h\* -prune \) -not \( -path \*h_\*/\* -prune \) -not \( -path \*w_\*/\* -prune \) -not \( -path \*../disk\* -prune \) -not \( -path \*../ssh\* -prune \) "$@"
}
#Recursively searches for directories.
_findAnchorSource() {
local anchorCurrentSearchDir
anchorCurrentSearchDir="$1"
shift
local anchorCurrentSearchDirAbsolute
anchorCurrentSearchDirAbsolute=$(_getAbsoluteLocation "$anchorCurrentSearchDir")
_findAnchor "$anchorCurrentSearchDir" -path \*"$anchorSourcePath"
return
}
#Recursively searches for directories.
_findAnchorName() {
local anchorCurrentSearchDir
anchorCurrentSearchDir="$1"
shift
local anchorCurrentSearchDirAbsolute
anchorCurrentSearchDirAbsolute=$(_getAbsoluteLocation "$anchorCurrentSearchDir")
_findAnchor "$anchorCurrentSearchDir" -path \*_index/"$anchorName"
return
}
_check_anchor() {
local anchorCheckLine
while IFS='' read -r anchorCheckLine || [[ -n "$anchorCheckLine" ]]
do
#Conventionally a git submodule for compile purposes only.
[[ "$anchorCheckLine" == *'_lib/ubiquitous_bash/ubiquitous_bash.sh' ]] && continue
[[ "$anchorCheckLine" != *"$anchorSource" ]] && [[ "$anchorCheckLine" != *'ubiquitous_bash.sh' ]] && [[ "$anchorCheckLine" != *"$anchorName" ]] && continue
! _recursion_guard "$anchorCheckLine" && continue
_getAbsoluteLocation "$anchorCheckLine"
done
}
#_safeEcho_anchor "$anchorScriptAbsoluteFolder" | tr -dc 'a-zA-Z0-9.:_-'
_safeEcho_anchor() {
printf '%s' "$1"
shift
[[ "$@" == "" ]] && return 0
local currentArg
for currentArg in "$@"
do
printf '%s' " "
printf '%s' "$currentArg"
done
return 0
}
_launch_anchor() {
_messagePlain_nominal 'anchorName='"$anchorName" | _user_log_anchor
_messagePlain_probe 'anchorScriptAbsoluteLocation='"$anchorScriptAbsoluteLocation" | _user_log_anchor
_messagePlain_probe 'anchorScriptAbsoluteFolder='"$anchorScriptAbsoluteFolder" | _user_log_anchor
_messagePlain_probe 'anchorSourcePath='"$anchorSourcePath" | _user_log_anchor
_messagePlain_probe 'anchorLabName='"$anchorLabName" | _user_log_anchor
_messagePlain_probe 'anchorLabNameAlt='"$anchorLabNameAlt" | _user_log_anchor
_messagePlain_probe 'anchorEntity='"$anchorEntity" | _user_log_anchor
local recursionExec
local anchorParent
# WARNING: What is otherwise considered bad practice may be accepted to reduce substantial MSW/Cygwin inconvenience .
if [[ "$anchorScriptAbsoluteFolder" == '/cygdrive/'* ]]
then
local currentDriveLetter
for currentDriveLetter in {a..z}
do
if [[ "$anchorScriptAbsoluteFolder" == '/cygdrive/'"$currentDriveLetter" ]]
then
recursionExec="$anchorScriptAbsoluteFolder"/"$anchorSource"
if _recursion_guard "$recursionExec"
then
[[ "$ub_import" != "true" ]] && _messagePlain_good 'self: 'bash "$recursionExec" "$anchorName" "$@" | _user_log_anchor
if [[ "$ub_import" != "true" ]]
then
bash "$recursionExec" "$anchorName" "$@"
exit $?
fi
[[ "$ub_import" == "true" ]] && _messagePlain_good 'self: 'bash "$recursionExec" "$ub_import_param" "$anchorName" "$@" | _user_log_anchor
[[ "$ub_import" == "true" ]] && bash "$recursionExec" "$ub_import_param" "$anchorName" "$@"
exit $?
fi
fi
done
fi
if [[ "$anchorScriptAbsoluteFolder" == '/home/user/project' ]] || [[ "$anchorScriptAbsoluteFolder" == /tmp/"$ubiquitiousBashIDnano" ]]
then
recursionExec="$anchorScriptAbsoluteFolder"/"$anchorSource"
if _recursion_guard "$recursionExec"
then
[[ "$ub_import" != "true" ]] && _messagePlain_good 'self: 'bash "$recursionExec" "$anchorName" "$@" | _user_log_anchor
if [[ "$ub_import" != "true" ]]
then
bash "$recursionExec" "$anchorName" "$@"
exit $?
fi
[[ "$ub_import" == "true" ]] && _messagePlain_good 'self: 'bash "$recursionExec" "$ub_import_param" "$anchorName" "$@" | _user_log_anchor
[[ "$ub_import" == "true" ]] && bash "$recursionExec" "$ub_import_param" "$anchorName" "$@"
exit $?
fi
fi
recursionExec="$anchorScriptAbsoluteFolder"/../"$anchorSourcePath"
if _recursion_guard "$recursionExec"
then
[[ "$ub_import" != "true" ]] && _messagePlain_good 'self: 'bash "$recursionExec" "$anchorName" "$@" | _user_log_anchor
if [[ "$ub_import" != "true" ]]
then
bash "$recursionExec" "$anchorName" "$@"
exit $?
fi
[[ "$ub_import" == "true" ]] && _messagePlain_good 'self: 'bash "$recursionExec" "$ub_import_param" "$anchorName" "$@" | _user_log_anchor
[[ "$ub_import" == "true" ]] && bash "$recursionExec" "$ub_import_param" "$anchorName" "$@"
exit $?
fi
#Resolves placement under "$anchorSourcePath"/_index .
recursionExec="$anchorScriptAbsoluteFolder"/../../"$anchorSourcePath"
if _recursion_guard "$recursionExec"
then
[[ "$ub_import" != "true" ]] && _messagePlain_good 'self: 'bash "$recursionExec" "$anchorName" "$@" | _user_log_anchor
if [[ "$ub_import" != "true" ]]
then
bash "$recursionExec" "$anchorName" "$@"
exit $?
fi
[[ "$ub_import" == "true" ]] && _messagePlain_good 'self: 'bash "$recursionExec" "$ub_import_param" "$anchorName" "$@" | _user_log_anchor
[[ "$ub_import" == "true" ]] && bash "$recursionExec" "$ub_import_param" "$anchorName" "$@"
exit $?
fi
anchorDestination=$(_findAnchorSource "$anchorScriptAbsoluteFolder"/.. | _check_anchor | _filter_lowestPath)
if [[ "$anchorDestination" != "" ]]
then
if [[ "$anchorDestination" == *"ubiquitous_bash.sh" ]]
then
_messagePlain_good 'launch: 'bash "$anchorDestination" "$ub_import_param" "$anchorName" "$@" | _user_log_anchor
if [[ "$ub_import" != "true" ]]
then
bash "$anchorDestination" "$anchorName" "$@"
exit $?
fi
[[ "$ub_import" == "true" ]] && bash "$anchorDestination" "$ub_import_param" "$anchorName" "$@"
exit $?
fi
_messagePlain_good 'launch: 'bash "$anchorDestination" "$ub_import_param" "$@" | _user_log_anchor
[[ "$ub_import" != "true" ]] && bash "$anchorDestination" "$@"
[[ "$ub_import" != "true" ]] && exit $?
[[ "$ub_import" == "true" ]] && bash "$anchorDestination" "$ub_import_param" "$@"
exit $?
fi
anchorParent=$(_getAbsoluteLocation "$anchorScriptAbsoluteFolder"/../..)
_messagePlain_probe 'anchorParent='"$anchorParent" | _user_log_anchor
if [[ "$anchorScriptAbsoluteFolder" == *"_local/_index" ]]
then
_messagePlain_probe 'detected: parent: _local/_index' | _user_log_anchor
anchorDestination=$(_findAnchorName "$anchorParent" | _check_anchor | _filter_highestPath)
if [[ "$anchorDestination" != "" ]]
then
_messagePlain_probe 'anchorDestination='"$anchorDestination" | _user_log_anchor
_messagePlain_good 'launch: 'bash "$anchorDestination" "$ub_import_param" "$@" | _user_log_anchor
[[ "$ub_import" != "true" ]] && bash "$anchorDestination" "$@"
[[ "$ub_import" != "true" ]] && exit $?
[[ "$ub_import" == "true" ]] && bash "$anchorDestination" "$ub_import_param" "$anchorName" "$@"
exit $?
fi
fi
recursionExec="$HOME"/core/infrastructure/vm/"$anchorSourcePath"
if _recursion_guard "$recursionExec"
then
[[ "$ub_import" != "true" ]] && _messagePlain_good 'launch: 'bash "$recursionExec" "$anchorName" "$@" | _user_log_anchor
if [[ "$ub_import" != "true" ]]
then
bash "$recursionExec" "$anchorName" "$@"
exit $?
fi
[[ "$ub_import" == "true" ]] && _messagePlain_good 'launch: 'bash "$recursionExec" "$ub_import_param" "$anchorName" "$@" | _user_log_anchor
[[ "$ub_import" == "true" ]] && bash "$recursionExec" "$ub_import_param" "$anchorName" "$@"
exit $?
fi
recursionExec="$HOME"/core/extra/infrastructure/vm/"$anchorSourcePath"
if _recursion_guard "$recursionExec"
then
[[ "$ub_import" != "true" ]] && _messagePlain_good 'launch: 'bash "$recursionExec" "$anchorName" "$@" | _user_log_anchor
if [[ "$ub_import" != "true" ]]
then
bash "$recursionExec" "$anchorName" "$@"
exit $?
fi
[[ "$ub_import" == "true" ]] && _messagePlain_good 'launch: 'bash "$recursionExec" "$ub_import_param" "$anchorName" "$@" | _user_log_anchor
[[ "$ub_import" == "true" ]] && bash "$recursionExec" "$ub_import_param" "$anchorName" "$@"
exit $?
fi
recursionExec="$HOME"/core/installations/"$anchorSourcePath"
if _recursion_guard "$recursionExec"
then
[[ "$ub_import" != "true" ]] && _messagePlain_good 'launch: 'bash "$recursionExec" "$anchorName" "$@" | _user_log_anchor
if [[ "$ub_import" != "true" ]]
then
bash "$recursionExec" "$anchorName" "$@"
exit $?
fi
[[ "$ub_import" == "true" ]] && _messagePlain_good 'launch: 'bash "$recursionExec" "$ub_import_param" "$anchorName" "$@" | _user_log_anchor
[[ "$ub_import" == "true" ]] && bash "$recursionExec" "$ub_import_param" "$anchorName" "$@"
exit $?
fi
recursionExec="$HOME"/core/extra/installations/"$anchorSourcePath"
if _recursion_guard "$recursionExec"
then
[[ "$ub_import" != "true" ]] && _messagePlain_good 'launch: 'bash "$recursionExec" "$anchorName" "$@" | _user_log_anchor
if [[ "$ub_import" != "true" ]]
then
bash "$recursionExec" "$anchorName" "$@"
exit $?
fi
[[ "$ub_import" == "true" ]] && _messagePlain_good 'launch: 'bash "$recursionExec" "$ub_import_param" "$anchorName" "$@" | _user_log_anchor
[[ "$ub_import" == "true" ]] && bash "$recursionExec" "$ub_import_param" "$anchorName" "$@"
exit $?
fi
recursionExec="$HOME"/core/lab/"$anchorEntity""$anchorLabName"/_index/"$anchorName"
if _recursion_guard "$recursionExec"
then
[[ "$ub_import" != "true" ]] && _messagePlain_good 'reference: 'bash "$recursionExec" "$@" | _user_log_anchor
if [[ "$ub_import" != "true" ]]
then
bash "$recursionExec" "$@"
exit $?
fi
[[ "$ub_import" == "true" ]] && _messagePlain_good 'reference: 'bash "$recursionExec" "$ub_import_param" "$@" | _user_log_anchor
[[ "$ub_import" == "true" ]] && bash "$recursionExec" "$ub_import_param" "$@"
exit $?
fi
recursionExec="$HOME"/core/extra/lab/"$anchorEntity""$anchorLabName"/_index/"$anchorName"
if _recursion_guard "$recursionExec"
then
[[ "$ub_import" != "true" ]] && _messagePlain_good 'reference: 'bash "$recursionExec" "$@" | _user_log_anchor
if [[ "$ub_import" != "true" ]]
then
bash "$recursionExec" "$@"
exit $?
fi
[[ "$ub_import" == "true" ]] && _messagePlain_good 'reference: 'bash "$recursionExec" "$ub_import_param" "$@" | _user_log_anchor
[[ "$ub_import" == "true" ]] && bash "$recursionExec" "$ub_import_param" "$@"
exit $?
fi
recursionExec="$HOME"/core/lab/"$anchorEntity""$anchorLabNameAlt"/_index/"$anchorName"
if _recursion_guard "$recursionExec"
then
[[ "$ub_import" != "true" ]] && _messagePlain_good 'reference: 'bash "$recursionExec" "$@" | _user_log_anchor
if [[ "$ub_import" != "true" ]]
then
bash "$recursionExec" "$@"
exit $?
fi
[[ "$ub_import" == "true" ]] && _messagePlain_good 'reference: 'bash "$recursionExec" "$ub_import_param" "$@" | _user_log_anchor
[[ "$ub_import" == "true" ]] && bash "$recursionExec" "$ub_import_param" "$@"
exit $?
fi
recursionExec="$HOME"/core/extra/lab/"$anchorEntity""$anchorLabNameAlt"/_index/"$anchorName"
if _recursion_guard "$recursionExec"
then
[[ "$ub_import" != "true" ]] && _messagePlain_good 'reference: 'bash "$recursionExec" "$@" | _user_log_anchor
if [[ "$ub_import" != "true" ]]
then
bash "$recursionExec" "$@"
exit $?
fi
[[ "$ub_import" == "true" ]] && _messagePlain_good 'reference: 'bash "$recursionExec" "$ub_import_param" "$@" | _user_log_anchor
[[ "$ub_import" == "true" ]] && bash "$recursionExec" "$ub_import_param" "$@"
exit $?
fi
_messagePlain_bad 'missing: '"$anchorSource" | _user_log_anchor
return 1
}
export anchorScriptAbsoluteLocation=$(_getScriptAbsoluteLocation)
export anchorScriptAbsoluteFolder=$(_getScriptAbsoluteFolder)
export anchorName=$(basename "$anchorScriptAbsoluteLocation" | sed 's/\.bat$//g')
export anchorSourceDir="ubDistBuild"
export anchorSource="ubiquitous_bash.sh"
export anchorSourcePath="$anchorSourceDir"/"$anchorSource"
export anchorLabName=anchorLabName
export anchorLabNameAlt="$anchorLabName"Mini
export anchorEntity=""
#export anchorEntity="entity/"
if [[ "$anchorName" == "_anchor" ]]
then
! [[ -e "$anchorScriptAbsoluteFolder"/"$anchorSource" ]] && exit 1
"$anchorScriptAbsoluteFolder"/"$anchorSource" _anchor
exit "$?"
fi
if [[ "$1" == 'MSWselfReinterpret' ]]
then
# ATTENTION: DANGER: Not yet implemented. Add the alternate functionality in production use.
shift
exit 1
fi
# ATTENTION: DANGER: Comment out in production use.
#_test() {
# echo PASS-BASH
#}
#_test
# ATTENTION: DANGER: Uncomment in production use.
_launch_anchor "$@"
exit "$?"
#_findAnchorName .