Skip to content

Commit f107375

Browse files
author
William Blankenship
authored
Merge pull request #82 from retrohacker/added-manjaro-linux-os
Added manjaro linux os
2 parents e290eff + 0a52c31 commit f107375

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

logic/manjaro.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
var releaseRegex = /distrib_release=(.*)/
2+
var codenameRegex = /distrib_codename=(.*)/
3+
4+
module.exports = function ubuntuCustomLogic (os, file, cb) {
5+
var codename = file.match(codenameRegex)
6+
if (codename && codename.length === 2) os.codename = codename[1]
7+
var release = file.match(releaseRegex)
8+
if (release && release.length === 2) os.release = release[1]
9+
cb(null, os)
10+
}

os.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"/etc/redhat-release" : ["RHEL","RHAS","Red Hat Linux","Scientific Linux","ScientificSL","ScientificCERNSLC","ScientificFermiLTS","ScientificSLF","Centos"],
44
"/etc/redhat_version" : ["RHEL","RHAS","Red Hat Linux","Scientific Linux","ScientificSL","ScientificCERNSLC","ScientificFermiLTS","ScientificSLF"],
55
"/etc/SuSE-release": ["SUSE Linux"],
6-
"/etc/lsb-release" : ["Ubuntu Linux","Chakra","IYCC","Linux Mint","elementary OS","Arch Linux"],
6+
"/etc/lsb-release" : ["Ubuntu Linux","Chakra","IYCC","Linux Mint","elementary OS","Arch Linux","Manjaro Linux"],
77
"/etc/debian_version" : ["Debian"],
88
"/etc/debian_release" : ["Debian"],
99
"/etc/os-release": ["Raspbian"],

tests/mockdata.json

+2
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,6 @@
2525
, { "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"}}
2626

2727
, { "desc": "Raspbian 8", "platform": "linux", "file": { "/etc/os-release": "PRETTY_NAME=\"Raspbian GNU/Linux 8 (jessie)\"\nNAME=\"Raspbian GNU/Linux\"\nVERSION_ID=\"8\"\nVERSION=\"8 (jessie)\"\nID=raspbian\nHOME_URL=\"http://www.raspbian.org/\"\nSUPPORT_URL=\"http://www.raspbian.org/RaspbianForums\"\nBUG_REPORT_URL=\"http://www.raspbian.org/RaspbianBugs\"" }, "expected": { "codename": "jessie", "dist": "Raspbian", "os": "linux", "release": "8" } }
28+
29+
, { "desc": "Manjaro Linux", "platform": "linux", "file": { "/etc/lsb-release": "DISTRIB_ID=ManjaroLinux\nDISTRIB_RELEASE=17.1.10\nDISTRIB_CODENAME=Hakoila\nDISTRIB_DESCRIPTION=\"Manjaro Linux\"" }, "expected": { "codename": "hakoila", "dist": "Manjaro Linux", "os": "linux", "release": "17.1.10" } }
2830
]

0 commit comments

Comments
 (0)