@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 ADDED
@@ -0,0 +1,13 @@
1
+ # @3-/srv-linux
2
+
3
+ ## 0.1.11
4
+
5
+ ### Patch Changes
6
+
7
+ - auto update
8
+
9
+ ## 0.1.10
10
+
11
+ ### Patch Changes
12
+
13
+ - 初始化 changesets 工作流
package/init.js ADDED
@@ -0,0 +1,6 @@
1
+ import { $ } from "zx";
2
+
3
+ $.verbose = true;
4
+ $.shell = "bash";
5
+
6
+ export { $ };
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 "zx";
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
- await fs.mkdir(systemd_dir, { recursive: true });
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.9",
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": "file:../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
@@ -3,7 +3,7 @@ Description=$name Daemon
3
3
  After=network.target
4
4
 
5
5
  [Service]
6
- ExecStart=$execPath $scriptPath run
6
+ ExecStart=$execPath "$scriptPath" run
7
7
  Restart=always
8
8
  StandardOutput=syslog
9
9
  StandardError=syslog
package/uninstall.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import fs from "fs/promises";
2
2
  import { homedir } from "os";
3
3
  import { join } from "path";
4
- import { $ } from "zx";
4
+ import { $ } from "./init.js";
5
5
 
6
6
  export default async ({ name }) => {
7
7
  const systemd_dir = join(homedir(), ".config", "systemd", "user"),