Created
August 31, 2022 19:31
-
-
Save mikey-t/ee20254ebd1b8085758f362059154efd to your computer and use it in GitHub Desktop.
Auto start docker in wsl if it's not running. This is using @mikeyt23/node-cli-utils for waitForProcess/defaultSpawnOptions and assumes you'll use this task in a gulp series or parallel call.
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
async function startDockerIfNotRunning() { | |
const args = [ | |
'-u', | |
'root', | |
'-e', | |
'sh', | |
'-c', | |
'"service docker status || service docker start"' | |
] | |
await waitForProcess(spawn('wsl', args, defaultSpawnOptions)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment