@3-/srv-linux 0.1.9 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/init.js +6 -0
- package/install.js +7 -4
- package/package.json +2 -2
- package/systemd.service +1 -1
- package/uninstall.js +1 -1
package/CHANGELOG.md
ADDED
package/init.js
ADDED
package/install.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import fs from "fs/promises";
|
|
2
1
|
import { homedir } from "os";
|
|
3
2
|
import { join } from "path";
|
|
4
|
-
import { $ } from "
|
|
3
|
+
import { $ } from "./init.js";
|
|
5
4
|
import gen from "@3-/srv-obj-replace/gen.js";
|
|
6
5
|
|
|
7
6
|
export default async ({ name, scriptPath: script_path }) => {
|
|
@@ -9,8 +8,7 @@ export default async ({ name, scriptPath: script_path }) => {
|
|
|
9
8
|
systemd_dir = join(homedir(), ".config", "systemd", "user"),
|
|
10
9
|
service_path = join(systemd_dir, `${name}.service`);
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
await gen(
|
|
11
|
+
gen(
|
|
14
12
|
{ name, execPath: exec_path, scriptPath: script_path },
|
|
15
13
|
join(import.meta.dirname, "systemd.service"),
|
|
16
14
|
service_path
|
|
@@ -18,4 +16,9 @@ export default async ({ name, scriptPath: script_path }) => {
|
|
|
18
16
|
await $`systemctl --user daemon-reload`;
|
|
19
17
|
await $`systemctl --user stop ${name}.service || true`;
|
|
20
18
|
await $`systemctl --user enable --now ${name}.service`;
|
|
19
|
+
try {
|
|
20
|
+
await $`loginctl enable-linger $(whoami)`;
|
|
21
|
+
} catch (e) {
|
|
22
|
+
console.warn(e);
|
|
23
|
+
}
|
|
21
24
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@3-/srv-linux",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.11",
|
|
4
4
|
"os": [
|
|
5
5
|
"linux"
|
|
6
6
|
],
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"./uninstall.js": "./uninstall.js"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@3-/srv-obj-replace": "
|
|
13
|
+
"@3-/srv-obj-replace": "^0.1.11",
|
|
14
14
|
"zx": "^8.8.5"
|
|
15
15
|
},
|
|
16
16
|
"repository": "https://github.com/i18n-site/lib/tree/dev",
|
package/systemd.service
CHANGED
package/uninstall.js
CHANGED