From 711a7324393d139552cd6d3303bc92b075b33d10 Mon Sep 17 00:00:00 2001 From: Sander Date: Tue, 9 Jan 2024 23:29:58 +0000 Subject: [PATCH] daemon: fix reading trusted-users --- dist/main/index.js | 2 +- src/main.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/main/index.js b/dist/main/index.js index 7153f76c..77c0ef09 100644 --- a/dist/main/index.js +++ b/dist/main/index.js @@ -8017,7 +8017,7 @@ async function isWritable(path) { async function fetchTrustedUsers() { try { let conf = await execToVariable('nix', ['show-config'], { silent: true }); - let match = conf.match(/trusted-users = (.+);/); + let match = conf.match(/trusted-users = (.+)/m); return match?.length === 2 ? match[1].split(' ') : []; } catch (error) { diff --git a/src/main.ts b/src/main.ts index cf651161..0a83235b 100644 --- a/src/main.ts +++ b/src/main.ts @@ -337,8 +337,8 @@ async function isWritable(path: string): Promise { async function fetchTrustedUsers(): Promise { try { - let conf = await execToVariable('nix', ['show-config'], { silent: true }) - let match = conf.match(/trusted-users = (.+);/) + let conf = await execToVariable('nix', ['show-config'], { silent: true }); + let match = conf.match(/trusted-users = (.+)/m); return match?.length === 2 ? match[1].split(' ') : []; } catch (error) { core.warning('Failed to read the Nix configuration');