mirror of
https://github.com/cachix/install-nix-action.git
synced 2025-06-08 09:54:28 +00:00
Prepare for Nix 2.3.5
This commit is contained in:
parent
d3c3fef7d5
commit
642cfa0200
4 changed files with 10 additions and 73 deletions
17
src/main.ts
17
src/main.ts
|
@ -1,20 +1,3 @@
|
|||
import { execFileSync } from 'child_process';
|
||||
import { exit } from 'process';
|
||||
import { createConnection } from 'net';
|
||||
|
||||
async function awaitSocket() {
|
||||
const daemonSocket = createConnection({ path: '/nix/var/nix/daemon-socket/socket' });
|
||||
daemonSocket.on('error', async () => {
|
||||
console.log('Waiting for daemon socket to be available, reconnecting...');
|
||||
await new Promise(resolve => setTimeout(resolve, 500));
|
||||
await awaitSocket();
|
||||
});
|
||||
daemonSocket.on('connect', () => {
|
||||
exit(0);
|
||||
});
|
||||
}
|
||||
|
||||
execFileSync(`${__dirname}/install-nix.sh`, { stdio: 'inherit' });
|
||||
|
||||
// nc doesn't work correctly on macOS :(
|
||||
awaitSocket();
|
Loading…
Add table
Add a link
Reference in a new issue