@3-/srv-darwin 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 +4 -6
- package/launchd.xml +2 -0
- package/package.json +2 -2
- package/uninstall.js +2 -2
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 }) => {
|
|
@@ -13,12 +12,11 @@ export default async ({ name, scriptPath: script_path }) => {
|
|
|
13
12
|
out_log = join(logs_dir, `${name}.log`),
|
|
14
13
|
err_log = join(logs_dir, `${name}.err.log`);
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
await gen(
|
|
15
|
+
gen(
|
|
18
16
|
{ name, execPath: exec_path, scriptPath: script_path, outLog: out_log, errLog: err_log },
|
|
19
17
|
join(import.meta.dirname, "launchd.xml"),
|
|
20
18
|
plist_path
|
|
21
19
|
);
|
|
22
|
-
await $`launchctl bootout
|
|
23
|
-
await $`launchctl bootstrap
|
|
20
|
+
await $`launchctl bootout user/$(id -u) ${plist_path} || true`;
|
|
21
|
+
await $`launchctl bootstrap user/$(id -u) ${plist_path}`;
|
|
24
22
|
};
|
package/launchd.xml
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@3-/srv-darwin",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.11",
|
|
4
4
|
"os": [
|
|
5
5
|
"darwin"
|
|
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/uninstall.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import fs from "fs/promises";
|
|
2
2
|
import { homedir } from "os";
|
|
3
3
|
import { join } from "path";
|
|
4
|
-
import { $ } from "
|
|
4
|
+
import { $ } from "./init.js";
|
|
5
5
|
|
|
6
6
|
export default async ({ name }) => {
|
|
7
7
|
const home_dir = homedir(),
|
|
8
8
|
launch_agents_dir = join(home_dir, "Library", "LaunchAgents"),
|
|
9
9
|
plist_path = join(launch_agents_dir, `${name}.plist`);
|
|
10
10
|
|
|
11
|
-
await $`launchctl bootout
|
|
11
|
+
await $`launchctl bootout user/$(id -u) ${plist_path} || true`;
|
|
12
12
|
await fs.rm(plist_path, { force: true });
|
|
13
13
|
};
|