aboutsummaryrefslogtreecommitdiffstats
path: root/shlib/os.sh
diff options
context:
space:
mode:
Diffstat (limited to 'shlib/os.sh')
-rw-r--r--shlib/os.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/shlib/os.sh b/shlib/os.sh
new file mode 100644
index 0000000..1ac4f04
--- /dev/null
+++ b/shlib/os.sh
@@ -0,0 +1,15 @@
+# shellcheck shell=sh
+[ -n "${DOTFILES_OS_LOADED}" ] && return
+readonly DOTFILES_OS_LOADED=1
+
+os_print() {
+ uname
+}
+
+os_is_macos() {
+ [ "$(os_print)" = "Darwin" ]
+}
+
+os_is_linux() {
+ [ "$(os_print)" = "Linux" ]
+}