From 40b7b047a3fbf6451228de7f69c8ad5f156f7d1c Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sat, 6 Jun 2026 18:12:33 +0200 Subject: reorganize files --- lib/os.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 lib/os.sh (limited to 'lib/os.sh') diff --git a/lib/os.sh b/lib/os.sh new file mode 100644 index 0000000..01d70f4 --- /dev/null +++ b/lib/os.sh @@ -0,0 +1,30 @@ +# Copyright (c) 2016 Egor Tensin +# This file is part of the "Config file sharing" project. +# For details, see https://github.com/egor-tensin/config-links. +# Distributed under the MIT License. + +# Mostly Cygwin-related stuff + +is_cygwin() { + test "$OSTYPE" == 'cygwin' +} + +check_symlinks_enabled_cygwin() { + case "${CYGWIN-}" in + *winsymlinks:nativestrict*) ;; + *winsymlinks:native*) ;; + + *) + dump "native Windows symlinks aren't enabled in Cygwin" >&2 + return 1 + ;; + esac +} + +check_symlinks_enabled() { + if is_cygwin; then + check_symlinks_enabled_cygwin + else + return 0 + fi +} -- cgit v1.3