Skip to content

Commit

Permalink
fix: os-release should be checked last because it's mostly present in…
Browse files Browse the repository at this point in the history
… every Linux distribution (#88)
  • Loading branch information
Guillem CANAL authored and William Blankenship committed Aug 1, 2019
1 parent c58eef6 commit 87e7dce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions os.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"/etc/debian_version" : ["Debian"],
"/etc/debian_release" : ["Debian"],
"/etc/arch-release" : ["Arch Linux"],
"/etc/os-release": ["Raspbian"],
"/etc/NIXOS": ["NixOS"],
"/etc/annvix-release" : ["Annvix"],
"/etc/arklinux-release" : ["Arklinux"],
Expand Down Expand Up @@ -50,5 +49,6 @@
"/etc/va-release" : ["VA-Linux/RH-VALE"],
"/etc/yellowdog-release" : ["Yellow Dog"],
"/etc/alpine-release": ["Alpine Linux"],
"/etc/system-release": ["Amazon Linux"]
"/etc/system-release": ["Amazon Linux"],
"/etc/os-release": ["Raspbian"]
}
2 changes: 1 addition & 1 deletion tests/mockdata.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
, { "desc": "RHEL 6.6", "platform": "linux", "file": { "/etc/redhat-release": "Red Hat Enterprise Linux Server release 6.6 (Santiago)\n" }, "expected": { "codename": "santiago", "dist": "Red Hat Linux", "os": "linux", "release": "6.6" } }
, { "desc": "RHEL 7.0", "platform": "linux", "file": { "/etc/redhat-release": "Red Hat Enterprise Linux Server release 7.0 (Maipo)\n" }, "expected": { "codename": "maipo", "dist": "Red Hat Linux", "os": "linux", "release": "7.0" } }
, { "desc": "SUSE Linux", "platform": "linux", "file": { "/etc/SuSE-release": "SUSE Linux Enterprise Server 11 (x86_64)\nVERSION = 11\nPATCHLEVEL = 4\n" }, "expected": { "dist": "SUSE Linux", "os": "linux", "release": "11" } }
, { "desc": "Alpine Linux", "platform": "linux", "file": { "/etc/alpine-release": "3.3\n" }, "expected": { "dist": "Alpine Linux", "os": "linux", "release": "3.3" } }
, { "desc": "Alpine Linux", "platform": "linux", "file": { "/etc/alpine-release": "3.3\n", "/etc/os-release": "NAME=\"Alpine Linux\"\nID=alpine\nVERSION_ID=3.9.2\nPRETTY_NAME=\"Alpine Linux v3.9\"\nHOME_URL=\"https://alpinelinux.org/\"\nBUG_REPORT_URL=\"https://bugs.alpinelinux.org/\"\n" }, "expected": { "dist": "Alpine Linux", "os": "linux", "release": "3.3" } }
, { "desc": "Amazon Linux", "platform": "linux", "file": { "/etc/system-release": "Amazon Linux AMI release 2016.03"}, "expected": {"dist": "Amazon Linux", "os": "linux", "release": "2016.03"}}
, { "desc": "Arch Linux", "platform": "linux", "file": { "/etc/lsb-release": "LSB_VERSION=1.4\nDISTRIB_ID=Arch\nDISTRIB_RELEASE=rolling\nDISTRIB_DESCRIPTION=\"Arch Linux\""}, "expected": {"dist": "Arch Linux", "os": "linux", "release": "rolling"}}
, { "desc": "Linux Mint", "platform": "linux", "file": { "/etc/lsb-release": "DISTRIB_ID=LinuxMint\nDISTRIB_RELEASE=18\nDISTRIB_CODENAME=sarah\nDISTRIB_DESCRIPTION=\"Linux Mint 18 Sarah\""}, "expected": {"dist": "Linux Mint", "os": "linux", "codename": "sarah", "release": "18"}}
Expand Down

0 comments on commit 87e7dce

Please sign in to comment.