Skip to content

Commit

Permalink
Fix problem where user is not automatically determined from environme…
Browse files Browse the repository at this point in the history
…nt variables
  • Loading branch information
Hexagon committed Nov 21, 2024
1 parent df881f0 commit adf73ca
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cross/service",
"version": "1.0.6",
"version": "1.0.7",
"fmt": {
"lineWidth": 200
},
Expand Down
2 changes: 1 addition & 1 deletion lib/managers/systemd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class SystemdService {
// Automatically enable linger for current user using loginctl if running in user mode
if (!config.system && !onlyGenerate) {
if (!config.user) {
throw new Error("Username not found in $USER, must be specified using the --username flag or via the username option.");
throw new Error("Username not found in $USER, must be specified using the --username flag or via the user option.");
}
const enableLinger = await spawn(["loginctl", "enable-linger", config.user]);
if (enableLinger.code !== 0) {
Expand Down
2 changes: 1 addition & 1 deletion lib/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function prepareConfig<T extends InstallServiceOptions | UninstallServiceOptions
name: options.name || "deno-service",
home: options.home || getEnv("HOME") || getEnv("userprofile"),
cmd: "cmd" in options ? options.cmd : undefined,
user: "user" in options ? options.user || getEnv("USER") : undefined,
user: ("user" in options ? options.user : undefined) || getEnv("USER"),
cwd: "cwd" in options ? options.cwd || cwd() : undefined,
path: "path" in options ? options.path : undefined,
env: "env" in options ? options.env : undefined,
Expand Down

0 comments on commit adf73ca

Please sign in to comment.