Skip to content

Commit

Permalink
fetch-configlet: explicitly pass -s to uname (#808)
Browse files Browse the repository at this point in the history
I believe that a bare `uname` should do the same thing as `uname -s`
everywhere. But let's not rely on the reader knowing this, and instead
better communicate that we want the operating system name.

With GNU coreutils 9.3:

    $ uname --help
    Usage: uname [OPTION]...
    Print certain system information.  With no OPTION, same as -s.

      -a, --all                print all information, in the following order,
                                 except omit -p and -i if unknown:
      -s, --kernel-name        print the kernel name
    [...]

And on OpenBSD [1]:

    If no options are specified, uname prints the operating system name as if the -s option had been specified.

[1] https://man.openbsd.org/uname
  • Loading branch information
ee7 authored Aug 22, 2023
1 parent 4d387e9 commit f18d69c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/fetch-configlet
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ main() {
fi

local os
case "$(uname)" in
case "$(uname -s)" in
Darwin*) os='macos' ;;
Linux*) os='linux' ;;
Windows*) os='windows' ;;
Expand Down

0 comments on commit f18d69c

Please sign in to comment.