@longleash/cli 0.1.0-rc.7 → 0.1.0-rc.8
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/bin/longleash.mjs +16 -3
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/runtime/app/dist/assets/{app-DS3tqdbW.js → app-BIWNDTcN.js} +8 -8
- package/runtime/app/dist/assets/{styles-CkAMG7sK.css → styles-BKE-Ow8D.css} +1 -1
- package/runtime/app/dist/assets/{welcome-CitqOflI.js → welcome-U4wpRF4h.js} +1 -1
- package/runtime/app/dist/build.json +1 -1
- package/runtime/app/dist/index.html +3 -3
- package/runtime/app/dist/welcome.html +3 -3
- /package/runtime/app/dist/assets/{styles-C-1gzhnT.js → styles-CYy55gta.js} +0 -0
package/bin/longleash.mjs
CHANGED
|
@@ -1879,7 +1879,7 @@ function startService(context = {}) {
|
|
|
1879
1879
|
assertServiceInstallation(resolved);
|
|
1880
1880
|
if (resolved.platform === "darwin") {
|
|
1881
1881
|
if (launchdLoaded(resolved)) requireSuccess(resolved, "/bin/launchctl", ["kickstart", "-k", serviceTarget(resolved)]);
|
|
1882
|
-
else
|
|
1882
|
+
else bootstrapLaunchAgent(resolved);
|
|
1883
1883
|
} else {
|
|
1884
1884
|
requireSuccess(resolved, "systemctl", ["--user", "start", SYSTEMD_UNIT]);
|
|
1885
1885
|
}
|
|
@@ -1904,7 +1904,7 @@ function restartService(context = {}) {
|
|
|
1904
1904
|
assertServiceInstallation(resolved);
|
|
1905
1905
|
if (resolved.platform === "darwin") {
|
|
1906
1906
|
if (launchdLoaded(resolved)) requireSuccess(resolved, "/bin/launchctl", ["kickstart", "-k", serviceTarget(resolved)]);
|
|
1907
|
-
else
|
|
1907
|
+
else bootstrapLaunchAgent(resolved);
|
|
1908
1908
|
} else {
|
|
1909
1909
|
requireSuccess(resolved, "systemctl", ["--user", "restart", SYSTEMD_UNIT]);
|
|
1910
1910
|
}
|
|
@@ -1960,13 +1960,26 @@ function installLaunchAgent(context) {
|
|
|
1960
1960
|
writeManagedAtomically(context.paths.definition, content, 384, (temporary) => {
|
|
1961
1961
|
requireSuccess(context, "/usr/bin/plutil", ["-lint", temporary]);
|
|
1962
1962
|
});
|
|
1963
|
-
|
|
1963
|
+
bootstrapLaunchAgent(context);
|
|
1964
1964
|
} catch (error) {
|
|
1965
1965
|
restore(context.paths.definition, previous);
|
|
1966
1966
|
if (previous !== null && wasLoaded) run(context, "/bin/launchctl", ["bootstrap", launchDomain(context), context.paths.definition]);
|
|
1967
1967
|
throw error;
|
|
1968
1968
|
}
|
|
1969
1969
|
}
|
|
1970
|
+
function bootstrapLaunchAgent(context) {
|
|
1971
|
+
const args = ["bootstrap", launchDomain(context), context.paths.definition];
|
|
1972
|
+
const first = run(context, "/bin/launchctl", args);
|
|
1973
|
+
if (first.status === 0 || launchdLoaded(context)) return;
|
|
1974
|
+
run(context, "/bin/launchctl", ["bootout", serviceTarget(context)]);
|
|
1975
|
+
const retry = run(context, "/bin/launchctl", args);
|
|
1976
|
+
if (retry.status === 0 || launchdLoaded(context)) return;
|
|
1977
|
+
const failure = commandError("/bin/launchctl", args, retry);
|
|
1978
|
+
const firstDetail = (first.stderr || first.stdout).trim().replace(/\s+/g, " ").slice(0, 240);
|
|
1979
|
+
throw new Error(
|
|
1980
|
+
`${failure.message} launchd still rejected the managed job after one stale-state recovery attempt${firstDetail ? ` (first response: ${firstDetail})` : ""}. Run \`longleash service logs\` for daemon output.`
|
|
1981
|
+
);
|
|
1982
|
+
}
|
|
1970
1983
|
function installSystemdService(context) {
|
|
1971
1984
|
if (!context.paths.environment) throw new Error("The Linux service environment path is missing.");
|
|
1972
1985
|
const previousUnit = snapshot(context.paths.definition);
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@longleash/cli",
|
|
3
|
-
"version": "0.1.0-rc.
|
|
3
|
+
"version": "0.1.0-rc.8",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@longleash/cli",
|
|
9
|
-
"version": "0.1.0-rc.
|
|
9
|
+
"version": "0.1.0-rc.8",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"os": [
|
|
12
12
|
"darwin",
|