Created
April 27, 2017 10:18
-
-
Save KiaraGrouwstra/4040c324eff07424e81c2b8dd3e71eb1 to your computer and use it in GitHub Desktop.
aptgetDeps.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var R = require('ramda'); | |
var deps = R.pipe( | |
R.match(/Depends: ([\w-]+)/g), | |
R.map(R.replace('Depends: ', '')), | |
R.join(' '), | |
R.concat('sudo apt-get install '), | |
); | |
/* | |
usage: | |
var s = ` | |
liboxideqt-qmlplugin : Depends: liboxideqtcore0 (= 1.21.5-0ubuntu0.16.04.1) but it is not going to be installed | |
Depends: liboxideqtquick0 (= 1.21.5-0ubuntu0.16.04.1) but it is not going to be installed | |
qtdeclarative5-ubuntu-ui-toolkit-plugin : Depends: qml-module-ubuntu-components | |
Depends: qml-module-ubuntu-layouts but it is not going to be installed | |
Depends: qml-module-ubuntu-test but it is not going to be installed | |
`; | |
deps(s); | |
// -> "sudo apt-get install liboxideqtcore0 liboxideqtquick0 qml-module-ubuntu-components qml-module-ubuntu-layouts qml-module-ubuntu-test" | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment