Update .local/bin/install-program, .local/share/chezmoi/home/dot_local/bin/executable_install-program
This commit is contained in:
parent
01fcece369
commit
bc099cca12
2 changed files with 15 additions and 15 deletions
|
@ -243,25 +243,25 @@ 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') {
|
||||||
const docker = await which('docker')
|
const docker = which.sync('docker', { nothrow: true })
|
||||||
if (!docker) {
|
if (!docker) {
|
||||||
await $`brew install --cask docker`
|
await $`brew install --cask docker`
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
await $`docker run --rm hello-world`
|
await $`docker run --rm hello-world`
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
await $`logg warn 'The command \`docker run --rm hello-world\` failed`
|
await $`logg warn 'The command \`docker run --rm hello-world\` failed'`
|
||||||
try {
|
try {
|
||||||
await $`test -f /Applications/Docker.app`
|
const promises = [$`test -d /Applications/Docker.app`, $`logg info 'Attempting to open \`/Applications/Docker.app\` (Docker Desktop for macOS). This should take about 30 seconds.'`, $`open /Applications/Docker.app`]
|
||||||
await $`logg info 'Attempting to open \`Applications/Docker.app\` (Docker Desktop for macOS). This should take about 30 seconds.'`
|
await Promise.all(promises)
|
||||||
const gum = await which('gum')
|
const gum = which.sync('gum', { nothrow: true })
|
||||||
if (gum) {
|
if (gum) {
|
||||||
await $`gum spin --spinner dot --title "Waiting for Docker Desktop to start up.." -- sleep 30`
|
execSync('gum spin --spinner dot --title "Waiting for Docker Desktop to start up.." -- sleep 30', {stdio: 'inherit', shell: true})
|
||||||
} else {
|
} else {
|
||||||
await $`sleep 30`
|
await $`sleep 30`
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
await $`logg warn 'Docker Desktop appears to not be installed!`
|
await $`logg warn 'Docker Desktop appears to not be installed!'`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -242,26 +242,26 @@ 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') {
|
if (osType === 'darwin') {
|
||||||
const docker = await which('docker')
|
const docker = which.sync('docker', { nothrow: true })
|
||||||
if (!docker) {
|
if (!docker) {
|
||||||
await $`brew install --cask docker`
|
await $`brew install --cask docker`
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
await $`docker run --rm hello-world`
|
await $`docker run --rm hello-world`
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
await $`logg warn 'The command \`docker run --rm hello-world\` failed`
|
await $`logg warn 'The command \`docker run --rm hello-world\` failed'`
|
||||||
try {
|
try {
|
||||||
await $`test -f /Applications/Docker.app`
|
const promises = [$`test -d /Applications/Docker.app`, $`logg info 'Attempting to open \`/Applications/Docker.app\` (Docker Desktop for macOS). This should take about 30 seconds.'`, $`open /Applications/Docker.app`]
|
||||||
await $`logg info 'Attempting to open \`Applications/Docker.app\` (Docker Desktop for macOS). This should take about 30 seconds.'`
|
await Promise.all(promises)
|
||||||
const gum = await which('gum')
|
const gum = which.sync('gum', { nothrow: true })
|
||||||
if (gum) {
|
if (gum) {
|
||||||
await $`gum spin --spinner dot --title "Waiting for Docker Desktop to start up.." -- sleep 30`
|
execSync('gum spin --spinner dot --title "Waiting for Docker Desktop to start up.." -- sleep 30', {stdio: 'inherit', shell: true})
|
||||||
} else {
|
} else {
|
||||||
await $`sleep 30`
|
await $`sleep 30`
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
await $`logg warn 'Docker Desktop appears to not be installed!`
|
await $`logg warn 'Docker Desktop appears to not be installed!'`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue