fix install shadow-cljs
This commit is contained in:
parent
252cbc0f25
commit
653856d629
1 changed files with 20 additions and 3 deletions
|
@ -3,9 +3,26 @@ package org.domaindrivenarchitecture.provs.desktop.infrastructure
|
|||
import org.domaindrivenarchitecture.provs.framework.core.Prov
|
||||
import org.domaindrivenarchitecture.provs.framework.core.ProvResult
|
||||
import org.domaindrivenarchitecture.provs.framework.ubuntu.install.base.aptInstall
|
||||
import org.domaindrivenarchitecture.provs.framework.ubuntu.install.base.isPackageInstalled
|
||||
|
||||
fun Prov.installShadowCljs(): ProvResult = task {
|
||||
aptInstall("npm")
|
||||
cmd("npm install -g npx", sudo = true)
|
||||
cmd("npm install -g shadow-cljs", sudo = true)
|
||||
|
||||
if (!isPackageInstalled("npm")) {
|
||||
aptInstall("npm")
|
||||
cmd("sudo npm install -g npx")
|
||||
cmd("sudo npm install -g shadow-cljs")
|
||||
} else {
|
||||
val npmVersion = cmd("npm --version")
|
||||
ProvResult(true, out = "Package npm v$npmVersion already installed. Checking shadow-cljs now.")
|
||||
if (chk("npm list -g shadow-cljs|grep empty")) {
|
||||
cmd("sudo npm install -g shadow-cljs")
|
||||
} else {
|
||||
ProvResult(true, out = "Package shadow-cljs already installed.")
|
||||
}
|
||||
if (chk("npm list -g npx|grep empty")) {
|
||||
cmd("sudo npm install -g npx")
|
||||
} else {
|
||||
ProvResult(true, out = "Package npx already installed.")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue