From c9b9c77f3b4dfe61fb75c39af48d928bef898f94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Domen=20Ko=C5=BEar?= Date: Tue, 19 Nov 2019 12:59:36 +0100 Subject: [PATCH] wait for nix-daemon socket --- lib/main.js | 4 ++++ src/main.ts | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/lib/main.js b/lib/main.js index 0c351bf..d5999ad 100644 --- a/lib/main.js +++ b/lib/main.js @@ -62,6 +62,10 @@ function run() { if (os_1.type() == "Darwin") { // macOS needs certificates hints core.exportVariable('NIX_SSL_CERT_FILE', '/nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt'); + // TODO: nc doesn't work correctly on macOS :( + //await exec.exec("sh", ["-c", "while ! nc -zU /nix/var/nix/daemon-socket/socket; do sleep 0.5; done"]); + // macOS needs time to reload the daemon :( + yield exec.exec("sleep", ["10"]); } } catch (error) { diff --git a/src/main.ts b/src/main.ts index 7ceeeda..d6434db 100644 --- a/src/main.ts +++ b/src/main.ts @@ -52,6 +52,11 @@ async function run() { if (type() == "Darwin") { // macOS needs certificates hints core.exportVariable('NIX_SSL_CERT_FILE', '/nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt'); + + // TODO: nc doesn't work correctly on macOS :( + //await exec.exec("sh", ["-c", "while ! nc -zU /nix/var/nix/daemon-socket/socket; do sleep 0.5; done"]); + // macOS needs time to reload the daemon :( + await exec.exec("sleep", ["10"]); } } catch (error) {