-
Notifications
You must be signed in to change notification settings - Fork 1
/
core.sh
executable file
·35 lines (32 loc) · 1.15 KB
/
core.sh
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
#!/bin/bash
# /*
# Library:
# The mac-libs library contains functionality to ease repeated needs in macOS management scripts.
#
# Usage:
# Usage depends on how scripts are run; the stub you source can change which user the functions interact with.
#
# This stub is for scripts run as the shell user:
#
# * All user functions will automatically use the $USER environment variable.
# * Includes various 'error::xxx' functions.
#
# For scripts intended to interact with a different user, or run via Jamf Pro, see "root.sh" or "jamf.sh"
#
# Example:
#
# source "<path-to-os-libs>/core.sh"
# source "<path-to-os-libs>/other/lib/script.sh"
#
# Library Copyright:
# © 2022/09 AMJones <am@jonesiscoding.com>
#
# Some code attributable to other sources and offers. See comments in specific functions.
#
# License:
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
# */
[ -z "$libsMacUser" ] && libsMacUser="$USER"
# shellcheck source=./_errors.sh disable=SC2164
source "$( cd "$(/usr/bin/dirname "${BASH_SOURCE[0]}")" ; /bin/pwd -P )/_errors.sh"