aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/%HOME%/.bash_utils
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-01-27 09:56:11 +0100
committerEgor Tensin <Egor.Tensin@gmail.com>2023-01-27 09:56:11 +0100
commit8455133e10ee9e36541e013613f14f12d96b8a48 (patch)
tree937bf7a41b050489393653d97a58c7f7d02b1e88 /%HOME%/.bash_utils
parentvim: enable settings explicitly (diff)
downloadlinux-home-8455133e10ee9e36541e013613f14f12d96b8a48.tar.gz
linux-home-8455133e10ee9e36541e013613f14f12d96b8a48.zip
.bash_utils: get rid of uname usage
Diffstat (limited to '%HOME%/.bash_utils')
-rw-r--r--%HOME%/.bash_utils/cxx.sh11
-rw-r--r--%HOME%/.bash_utils/os.sh5
2 files changed, 5 insertions, 11 deletions
diff --git a/%HOME%/.bash_utils/cxx.sh b/%HOME%/.bash_utils/cxx.sh
index bd9885f..5ad27ca 100644
--- a/%HOME%/.bash_utils/cxx.sh
+++ b/%HOME%/.bash_utils/cxx.sh
@@ -5,14 +5,9 @@
# For details, see https://github.com/egor-tensin/linux-home.
# Distributed under the MIT License.
-_runc_os_is_cygwin() (
- set -o errexit -o nounset -o pipefail
- shopt -s inherit_errexit
-
- local os
- os="$( uname -o )"
- test 'Cygwin' = "$os"
-)
+_runc_os_is_cygwin() {
+ test "$OSTYPE" = cygwin
+}
if _runc_os_is_cygwin; then
_runc_exe_ext='.exe'
diff --git a/%HOME%/.bash_utils/os.sh b/%HOME%/.bash_utils/os.sh
index 7a38ec9..c20203c 100644
--- a/%HOME%/.bash_utils/os.sh
+++ b/%HOME%/.bash_utils/os.sh
@@ -15,9 +15,8 @@ _ARCH_ARM='Arch Linux ARM'
_FEDORA='Fedora'
os_detect() {
- command -v uname > /dev/null \
- && [ "$( uname -o )" == "$_CYGWIN" ] \
- && _os="$_CYGWIN" \
+ [ "$OSTYPE" == cygwin ] \
+ && _os="$_CYGWIN" \
&& return 0
[ -r /etc/os-release ] \