@david_was/nenna 0.1.6 → 0.1.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/cli/nenna.js +31 -14
- package/package.json +1 -1
- package/publish/nenna.deps.json +2 -2
- package/publish/nenna.dll +0 -0
- package/publish/nenna.pdb +0 -0
package/cli/nenna.js
CHANGED
|
@@ -67,21 +67,38 @@ try {
|
|
|
67
67
|
// If the file is unreadable the update check is simply skipped.
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
+
// Exit code returned by the .NET CLI after a successful update to signal
|
|
71
|
+
// that this wrapper should restart the CLI so the new version becomes active.
|
|
72
|
+
const EXIT_CODE_RESTART = 42;
|
|
73
|
+
|
|
70
74
|
const args = process.argv.slice(2);
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
75
|
+
|
|
76
|
+
function run(cliArgs) {
|
|
77
|
+
const result = spawnSync('dotnet', [dllPath, ...cliArgs], { stdio: 'inherit' });
|
|
78
|
+
|
|
79
|
+
if (result.error) {
|
|
80
|
+
if (result.error.code === 'ENOENT') {
|
|
81
|
+
console.error(
|
|
82
|
+
'✗ nenna requires the .NET runtime, but `dotnet` was not found on your PATH.\n' +
|
|
83
|
+
' Install the .NET 10 runtime (the full SDK also works) from:\n' +
|
|
84
|
+
' https://dotnet.microsoft.com/download/dotnet/10.0\n' +
|
|
85
|
+
' Then re-run this command.'
|
|
86
|
+
);
|
|
87
|
+
} else {
|
|
88
|
+
console.error(`✗ nenna: failed to launch dotnet: ${result.error.message}`);
|
|
89
|
+
}
|
|
90
|
+
process.exit(1);
|
|
83
91
|
}
|
|
84
|
-
|
|
92
|
+
|
|
93
|
+
return result.status === null ? 1 : result.status;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
let status = run(args);
|
|
97
|
+
|
|
98
|
+
// A successful update signals a restart: re-exec with `chat --continue` so
|
|
99
|
+
// the newly installed binary picks up the last session immediately.
|
|
100
|
+
if (status === EXIT_CODE_RESTART) {
|
|
101
|
+
status = run(['chat', '--continue']);
|
|
85
102
|
}
|
|
86
103
|
|
|
87
104
|
// Start the background update check after the main process finishes.
|
|
@@ -92,4 +109,4 @@ if (currentVersion) {
|
|
|
92
109
|
if (handle.unref) handle.unref();
|
|
93
110
|
}
|
|
94
111
|
|
|
95
|
-
process.exit(
|
|
112
|
+
process.exit(status);
|
package/package.json
CHANGED
package/publish/nenna.deps.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"compilationOptions": {},
|
|
7
7
|
"targets": {
|
|
8
8
|
".NETCoreApp,Version=v10.0": {
|
|
9
|
-
"nenna/0.1.
|
|
9
|
+
"nenna/0.1.8": {
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"Spectre.Console": "0.57.2"
|
|
12
12
|
},
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
"libraries": {
|
|
39
|
-
"nenna/0.1.
|
|
39
|
+
"nenna/0.1.8": {
|
|
40
40
|
"type": "project",
|
|
41
41
|
"serviceable": false,
|
|
42
42
|
"sha512": ""
|
package/publish/nenna.dll
CHANGED
|
Binary file
|
package/publish/nenna.pdb
CHANGED
|
Binary file
|