Update .local/share/chezmoi/home/dot_local/bin/executable_install-program, .local/bin/install-program
This commit is contained in:
parent
476c78748f
commit
01fcece369
2 changed files with 45 additions and 15 deletions
|
@ -242,6 +242,29 @@ async function beforeInstall(packageManager) {
|
||||||
} else if (packageManager === 'flatpak') {
|
} else if (packageManager === 'flatpak') {
|
||||||
} else if (packageManager === 'snap') {
|
} else if (packageManager === 'snap') {
|
||||||
} else if (packageManager === 'whalebrew') {
|
} else if (packageManager === 'whalebrew') {
|
||||||
|
if (osType === 'darwin') {
|
||||||
|
const docker = await which('docker')
|
||||||
|
if (!docker) {
|
||||||
|
await $`brew install --cask docker`
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
await $`docker run --rm hello-world`
|
||||||
|
} catch (e) {
|
||||||
|
await $`logg warn 'The command \`docker run --rm hello-world\` failed`
|
||||||
|
try {
|
||||||
|
await $`test -f /Applications/Docker.app`
|
||||||
|
await $`logg info 'Attempting to open \`Applications/Docker.app\` (Docker Desktop for macOS). This should take about 30 seconds.'`
|
||||||
|
const gum = await which('gum')
|
||||||
|
if (gum) {
|
||||||
|
await $`gum spin --spinner dot --title "Waiting for Docker Desktop to start up.." -- sleep 30`
|
||||||
|
} else {
|
||||||
|
await $`sleep 30`
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
await $`logg warn 'Docker Desktop appears to not be installed!`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
} else if (packageManager === 'winget') {
|
} else if (packageManager === 'winget') {
|
||||||
} else if (packageManager === 'yay') {
|
} else if (packageManager === 'yay') {
|
||||||
} else if (packageManager === 'zypper') {
|
} else if (packageManager === 'zypper') {
|
||||||
|
|
|
@ -243,20 +243,27 @@ async function beforeInstall(packageManager) {
|
||||||
} else if (packageManager === 'snap') {
|
} else if (packageManager === 'snap') {
|
||||||
} else if (packageManager === 'whalebrew') {
|
} else if (packageManager === 'whalebrew') {
|
||||||
if (osType === 'darwin') {
|
if (osType === 'darwin') {
|
||||||
await $`
|
const docker = await which('docker')
|
||||||
if ! docker run --rm hello-world; then
|
if (!docker) {
|
||||||
logg warn 'The command `docker run --rm hello-world` failed'
|
await $`brew install --cask docker`
|
||||||
if [ -f '/Applications/Docker.app' ]; then
|
}
|
||||||
logg info 'Attempting to open `Applications/Docker.app` (Docker Desktop for macOS)'
|
try {
|
||||||
open /Applications/Docker.app
|
await $`docker run --rm hello-world`
|
||||||
if command -v gum > /dev/null; then
|
} catch (e) {
|
||||||
gum spin --spinner dot --title "Waiting for Docker Desktop to open and start the Docker daemon" -- sleep 30
|
await $`logg warn 'The command \`docker run --rm hello-world\` failed`
|
||||||
else
|
try {
|
||||||
sleep 30
|
await $`test -f /Applications/Docker.app`
|
||||||
fi
|
await $`logg info 'Attempting to open \`Applications/Docker.app\` (Docker Desktop for macOS). This should take about 30 seconds.'`
|
||||||
fi
|
const gum = await which('gum')
|
||||||
fi
|
if (gum) {
|
||||||
`
|
await $`gum spin --spinner dot --title "Waiting for Docker Desktop to start up.." -- sleep 30`
|
||||||
|
} else {
|
||||||
|
await $`sleep 30`
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
await $`logg warn 'Docker Desktop appears to not be installed!`
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (packageManager === 'winget') {
|
} else if (packageManager === 'winget') {
|
||||||
} else if (packageManager === 'yay') {
|
} else if (packageManager === 'yay') {
|
||||||
|
|
Loading…
Reference in a new issue