Git Product home page Git Product logo

whoru's Introduction

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 [email protected] (https://github.com/zixia)

Copyright & License

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

whoru's People

Contributors

bitdeli-chef avatar huan avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.