-
Notifications
You must be signed in to change notification settings - Fork 2
/
_xsrc
30 lines (27 loc) · 1002 Bytes
/
_xsrc
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
#! /usr/bin/env xs
LC_ALL = en_US.UTF-8
LANG = $LC_ALL
printf 'Locale: %s'\n $LC_ALL
umask 0022
path = /usr/local/bin /usr/bin /usr/sbin $home/.local/bin $home/bin
history = $home/.local/run/xshistory
catch {|e|
# Because I set autologin, an uncaught error in one of the scripts
# can be really insidious: error causes termination, which ends
# the session, which causes a new session to start; repeat.
#
# With this catcher, a "rescue" shell is spawned upon error.
# The rescue shell does *not* load functions from the environment;
# this breaks an error cycle caused by an incorrect definition.
# Loading continues upon leaving the rescue shell; the failing
# script is *not* loaded again.
echo $e
echo '~/.xsrc: Spawning rescue shell'
xs -p
} {
access -d /etc/xs/lib.d && {for f /etc/xs/lib.d/*.xs {. $f}}
access -d ~/.xslib.d && {for f ~/.xslib.d/*.xs {. $f}}
access -d /etc/xs/rc.d && {for f /etc/xs/rc.d/*.xs {. $f}}
access -d ~/.xsrc.d && {for f ~/.xsrc.d/*.xs {. $f}}
}
true