hmgr 0.0.36 → 0.0.37
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/dist/adapter/wsl.js +19 -18
- package/dist/gui/main.js +4 -1
- package/package.json +1 -1
package/dist/adapter/wsl.js
CHANGED
|
@@ -51,30 +51,31 @@ export function wslClaudeAusfuehrer(distro, ausfuehren) {
|
|
|
51
51
|
return { stdout: ausgabe.toString('utf8'), code };
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
|
-
/** Die Zeile, die dem `env` im Umgebungs-Skript vorausgeht; was davor steht (MOTD, Profil-Echo), ist Rauschen. */
|
|
55
|
-
export const UMGEBUNG_MARKER = '__HMGR_ENV__';
|
|
56
54
|
/**
|
|
57
|
-
* Liest die Umgebung einer Distro (E104): die Login-Shell des Benutzers, interaktiv und als
|
|
58
|
-
* (`-lic`), wie sie im Terminal der Distro läuft und `~/.profile` wie `~/.bashrc` liest. Die
|
|
59
|
-
*
|
|
55
|
+
* Liest die Umgebung einer Distro (E104, E105): die Login-Shell des Benutzers, interaktiv und als
|
|
56
|
+
* Login (`-lic`), wie sie im Terminal der Distro läuft und `~/.profile` wie `~/.bashrc` liest. Die
|
|
57
|
+
* Shell schreibt die Umgebung (`env -0`) auf fd 3, das hier auf das stdout des Skripts zeigt; ihr
|
|
58
|
+
* eigenes stdout und stderr gehen nach /dev/null. MOTD und Ausgaben aus `.profile`/`.bashrc`
|
|
59
|
+
* erreichen die Auswertung so nie. Gemessen in Ubuntu (bash) und Alpine (busybox sh).
|
|
60
60
|
*/
|
|
61
|
-
export const UMGEBUNG_IN_WSL_SKRIPT = 's=$(getent passwd "$(id -un)"
|
|
62
|
-
`exec "$s" -lic '
|
|
61
|
+
export const UMGEBUNG_IN_WSL_SKRIPT = 's=$(getent passwd "$(id -un)" | cut -d: -f7); [ -x "$s" ] || s=/bin/sh; ' +
|
|
62
|
+
`exec "$s" -lic 'env -0 >&3' 3>&1 >/dev/null 2>&1`;
|
|
63
63
|
/**
|
|
64
|
-
* Die Variablen aus der Ausgabe von `UMGEBUNG_IN_WSL_SKRIPT`:
|
|
65
|
-
*
|
|
66
|
-
*
|
|
64
|
+
* Die Variablen aus der Ausgabe von `UMGEBUNG_IN_WSL_SKRIPT`: NUL-getrennte Einträge `NAME=wert`,
|
|
65
|
+
* der Name bis zum ersten `=`. Der Wert darf `=` und Zeilenumbrüche enthalten. Einträge ohne `=`
|
|
66
|
+
* oder mit ungültigem Namen fallen weg. Leere Ausgabe (die Shell lieferte nichts): `undefined`.
|
|
67
67
|
*/
|
|
68
68
|
export function umgebungLesen(text) {
|
|
69
|
-
|
|
70
|
-
const ab = zeilen.map((z) => z.trim()).lastIndexOf(UMGEBUNG_MARKER);
|
|
71
|
-
if (ab === -1)
|
|
69
|
+
if (text.length === 0)
|
|
72
70
|
return undefined;
|
|
73
71
|
const variablen = {};
|
|
74
|
-
for (const
|
|
75
|
-
const
|
|
76
|
-
if (
|
|
77
|
-
|
|
72
|
+
for (const eintrag of text.split('\0')) {
|
|
73
|
+
const gleich = eintrag.indexOf('=');
|
|
74
|
+
if (gleich === -1)
|
|
75
|
+
continue;
|
|
76
|
+
const name = eintrag.slice(0, gleich);
|
|
77
|
+
if (/^[A-Za-z_][A-Za-z0-9_]*$/.test(name))
|
|
78
|
+
variablen[name] = eintrag.slice(gleich + 1);
|
|
78
79
|
}
|
|
79
80
|
return variablen;
|
|
80
81
|
}
|
|
@@ -195,7 +196,7 @@ export class WslBruecke {
|
|
|
195
196
|
}
|
|
196
197
|
/**
|
|
197
198
|
* Die Umgebung, die eine im Terminal der Distro gestartete claude sähe (E104); `undefined`, wenn
|
|
198
|
-
* sie nicht lesbar ist (Code ≠ 0,
|
|
199
|
+
* sie nicht lesbar ist (Code ≠ 0, leere Ausgabe, Zeitüberschreitung).
|
|
199
200
|
*/
|
|
200
201
|
async variablen() {
|
|
201
202
|
const { text, code } = await this.exec(['sh', '-c', UMGEBUNG_IN_WSL_SKRIPT]);
|
package/dist/gui/main.js
CHANGED
|
@@ -343,7 +343,10 @@ function registriereIpc() {
|
|
|
343
343
|
if (smoketest)
|
|
344
344
|
return;
|
|
345
345
|
if (geladenesPaketVorhanden) {
|
|
346
|
-
|
|
346
|
+
// E106: still (`/S`) und mit Wiederstart (`--force-run`). Ohne Argumente öffnet sich wegen
|
|
347
|
+
// `nsis.oneClick: false` (E73) der Installationsassistent; still übernimmt der Installer das
|
|
348
|
+
// bisherige Verzeichnis aus der Registry (InstallLocation) und startet hmgr danach selbst.
|
|
349
|
+
autoUpdater.quitAndInstall(true, true);
|
|
347
350
|
return;
|
|
348
351
|
}
|
|
349
352
|
app.relaunch();
|