fix(boot): default shell exit to shutdown

This commit is contained in:
Guillaume ARM 2026-06-10 01:17:43 +02:00
parent cb55fd7b61
commit b7187e0155
6 changed files with 11 additions and 11 deletions

View File

@ -1,6 +1,6 @@
{
"name": "TrapOS",
"version": "0.8.3",
"version": "0.8.4",
"branch": "next",
"packages": [
"trapos"

View File

@ -2,11 +2,11 @@
"packages": {
"trapos-core": "0.4.0",
"trapos-test": "0.2.1",
"trapos-boot": "0.3.1",
"trapos-boot": "0.3.2",
"trapos-net": "0.3.0",
"trapos-ui": "0.2.2",
"trapos-ai": "0.6.3",
"trapos-sandbox": "0.1.0",
"trapos": "0.8.3"
"trapos": "0.8.4"
}
}

View File

@ -1,6 +1,6 @@
{
"name": "trapos-boot",
"version": "0.3.1",
"version": "0.3.2",
"description": "TrapOS boot: startup MOTD and autostart server launcher",
"dependencies": ["trapos-core"],
"files": [

View File

@ -1,6 +1,6 @@
{
"name": "trapos",
"version": "0.8.3",
"version": "0.8.4",
"description": "TrapOS full install meta-package",
"dependencies": ["trapos-boot", "trapos-net", "trapos-ui", "trapos-test", "trapos-ai"],
"files": [],

View File

@ -26,7 +26,7 @@ local function init()
end
local function shouldShutdownOnShellExit()
return settings.get(SHUTDOWN_ON_SHELL_EXIT_SETTING) == true
return settings.get(SHUTDOWN_ON_SHELL_EXIT_SETTING) ~= false
end
init()

View File

@ -66,11 +66,11 @@ local function runStartupWithStubs(settingsValues)
return calls;
end
testlib.test('shell exit does not shut down by default', function()
testlib.test('shell exit shuts down by default', function()
local calls = runStartupWithStubs();
testlib.assertEquals(calls.shellRuns[1], 'shell');
testlib.assertEquals(calls.shutdown, false);
testlib.assertEquals(calls.shutdown, true);
testlib.assertEquals(calls.rebooted, false);
for _, message in ipairs(calls.prints) do
testlib.assertTrue(
@ -80,11 +80,11 @@ testlib.test('shell exit does not shut down by default', function()
end
end);
testlib.test('shell exit shuts down when setting is enabled', function()
local calls = runStartupWithStubs({ ['trapos.shutdown_on_shell_exit'] = true });
testlib.test('shell exit does not shut down when setting is disabled', function()
local calls = runStartupWithStubs({ ['trapos.shutdown_on_shell_exit'] = false });
testlib.assertEquals(calls.shellRuns[1], 'shell');
testlib.assertEquals(calls.shutdown, true);
testlib.assertEquals(calls.shutdown, false);
testlib.assertEquals(calls.rebooted, false);
end);