Skip to content

Commit

Permalink
Merge pull request #82 from retrohacker/added-manjaro-linux-os
Browse files Browse the repository at this point in the history
Added manjaro linux os
  • Loading branch information
William Blankenship authored Nov 22, 2018
2 parents e290eff + 0a52c31 commit f107375
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
10 changes: 10 additions & 0 deletions logic/manjaro.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
var releaseRegex = /distrib_release=(.*)/
var codenameRegex = /distrib_codename=(.*)/

module.exports = function ubuntuCustomLogic (os, file, cb) {
var codename = file.match(codenameRegex)
if (codename && codename.length === 2) os.codename = codename[1]
var release = file.match(releaseRegex)
if (release && release.length === 2) os.release = release[1]
cb(null, os)
}
2 changes: 1 addition & 1 deletion os.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"/etc/redhat-release" : ["RHEL","RHAS","Red Hat Linux","Scientific Linux","ScientificSL","ScientificCERNSLC","ScientificFermiLTS","ScientificSLF","Centos"],
"/etc/redhat_version" : ["RHEL","RHAS","Red Hat Linux","Scientific Linux","ScientificSL","ScientificCERNSLC","ScientificFermiLTS","ScientificSLF"],
"/etc/SuSE-release": ["SUSE Linux"],
"/etc/lsb-release" : ["Ubuntu Linux","Chakra","IYCC","Linux Mint","elementary OS","Arch Linux"],
"/etc/lsb-release" : ["Ubuntu Linux","Chakra","IYCC","Linux Mint","elementary OS","Arch Linux","Manjaro Linux"],
"/etc/debian_version" : ["Debian"],
"/etc/debian_release" : ["Debian"],
"/etc/os-release": ["Raspbian"],
Expand Down
2 changes: 2 additions & 0 deletions tests/mockdata.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@
, { "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"}}

, { "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" } }

, { "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" } }
]

0 comments on commit f107375

Please sign in to comment.