Skip to content

Commit

Permalink
daemon: fix reading trusted-users
Browse files Browse the repository at this point in the history
  • Loading branch information
sandydoo committed Jan 9, 2024
1 parent 8426524 commit 711a732
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,8 @@ async function isWritable(path: string): Promise<boolean> {

async function fetchTrustedUsers(): Promise<string[]> {
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');
Expand Down

0 comments on commit 711a732

Please sign in to comment.