Skip to content
/ whoru Public

whoru is a command line tool to query name/version/arch of a linux distribution, like whoami query the uid/name/group.

License

Notifications You must be signed in to change notification settings

huan/whoru

Repository files navigation

whoru

Bitdeli Badge Travis Status CircleCI Status Codeship Status for zixia/whoru Code Climate

What is whoru?

whoru is a command line tool that query name/version/arch of a linux distribution. it's like whoami, which query the uid/name/group of a user.

whoru github - https://github.com/zixia/whoru

  • WHORU_DIST = distribution name
  • WHORU_VER = version
  • WHORU_ARCH = architecture

Usage

$ eval $(curl -s https://raw.githubusercontent.com/zixia/whoru/master/whoru | bash -)
$ echo $WHORU_{DIST,VER,ARCH}

will output (in this case we ran inside ubuntu)

ubuntu 14 x86_64

Example

whoru on debian whoru on fedora whoru on macos

Installation

Copy whoru file to /usr/local/bin, or anywhere that PATH could find.

Test

whoru use bats and docker to test itself.

$ bats test

will run a full test on every distributions and versions defined in the test directory.

 $ bats test/
 ✓ CentOS 5
 ✓ CentOS 6
 - CentOS 7 (skipped: not support yet)
 - Debian 6 (skipped: not support yet)
 ✓ Debian 7
 ✓ Debian 8
 ✓ Fedora 20
 ✓ Fedora 21
 ✓ Fedora 22
 ✓ Ubuntu 12.04
 ✓ Ubuntu 13.04
 ✓ Ubuntu 14.04
 ✓ Ubuntu 15.04
 ✓ Ubuntu 15.10

14 tests, 0 failures, 2 skipped

What is BATS?

BATS(Bash Automated Testing System) is a bash implementation of TAP(Test Anything Protol)

Install BATS

$ BATS_VERSION=0.4.0 \
    curl -s -L "https://github.com/sstephenson/bats/archive/v${BATS_VERSION}.tar.gz" 
    | tar zxv 
    && bats-${BATS_VERSION}/install.sh /usr/local

Bug

From now, whoru is very simple and only support very limited linux distribution, for example: redhat, fedora, centos, debian, mac os .

contribution is very welcome.

Author

LI Zhuohuan zixia@zixia.net (https://github.com/zixia)

Copyright & License

  • Code & Documentation 2015© zixia
  • Code released under the Apache 2.0 license
  • Docs released under Creative Commons.

About

whoru is a command line tool to query name/version/arch of a linux distribution, like whoami query the uid/name/group.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages