fix(boot): default shell exit to shutdown
This commit is contained in:
parent
cb55fd7b61
commit
b7187e0155
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "TrapOS",
|
"name": "TrapOS",
|
||||||
"version": "0.8.3",
|
"version": "0.8.4",
|
||||||
"branch": "next",
|
"branch": "next",
|
||||||
"packages": [
|
"packages": [
|
||||||
"trapos"
|
"trapos"
|
||||||
|
|||||||
@ -2,11 +2,11 @@
|
|||||||
"packages": {
|
"packages": {
|
||||||
"trapos-core": "0.4.0",
|
"trapos-core": "0.4.0",
|
||||||
"trapos-test": "0.2.1",
|
"trapos-test": "0.2.1",
|
||||||
"trapos-boot": "0.3.1",
|
"trapos-boot": "0.3.2",
|
||||||
"trapos-net": "0.3.0",
|
"trapos-net": "0.3.0",
|
||||||
"trapos-ui": "0.2.2",
|
"trapos-ui": "0.2.2",
|
||||||
"trapos-ai": "0.6.3",
|
"trapos-ai": "0.6.3",
|
||||||
"trapos-sandbox": "0.1.0",
|
"trapos-sandbox": "0.1.0",
|
||||||
"trapos": "0.8.3"
|
"trapos": "0.8.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "trapos-boot",
|
"name": "trapos-boot",
|
||||||
"version": "0.3.1",
|
"version": "0.3.2",
|
||||||
"description": "TrapOS boot: startup MOTD and autostart server launcher",
|
"description": "TrapOS boot: startup MOTD and autostart server launcher",
|
||||||
"dependencies": ["trapos-core"],
|
"dependencies": ["trapos-core"],
|
||||||
"files": [
|
"files": [
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "trapos",
|
"name": "trapos",
|
||||||
"version": "0.8.3",
|
"version": "0.8.4",
|
||||||
"description": "TrapOS full install meta-package",
|
"description": "TrapOS full install meta-package",
|
||||||
"dependencies": ["trapos-boot", "trapos-net", "trapos-ui", "trapos-test", "trapos-ai"],
|
"dependencies": ["trapos-boot", "trapos-net", "trapos-ui", "trapos-test", "trapos-ai"],
|
||||||
"files": [],
|
"files": [],
|
||||||
|
|||||||
@ -26,7 +26,7 @@ local function init()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function shouldShutdownOnShellExit()
|
local function shouldShutdownOnShellExit()
|
||||||
return settings.get(SHUTDOWN_ON_SHELL_EXIT_SETTING) == true
|
return settings.get(SHUTDOWN_ON_SHELL_EXIT_SETTING) ~= false
|
||||||
end
|
end
|
||||||
|
|
||||||
init()
|
init()
|
||||||
|
|||||||
@ -66,11 +66,11 @@ local function runStartupWithStubs(settingsValues)
|
|||||||
return calls;
|
return calls;
|
||||||
end
|
end
|
||||||
|
|
||||||
testlib.test('shell exit does not shut down by default', function()
|
testlib.test('shell exit shuts down by default', function()
|
||||||
local calls = runStartupWithStubs();
|
local calls = runStartupWithStubs();
|
||||||
|
|
||||||
testlib.assertEquals(calls.shellRuns[1], 'shell');
|
testlib.assertEquals(calls.shellRuns[1], 'shell');
|
||||||
testlib.assertEquals(calls.shutdown, false);
|
testlib.assertEquals(calls.shutdown, true);
|
||||||
testlib.assertEquals(calls.rebooted, false);
|
testlib.assertEquals(calls.rebooted, false);
|
||||||
for _, message in ipairs(calls.prints) do
|
for _, message in ipairs(calls.prints) do
|
||||||
testlib.assertTrue(
|
testlib.assertTrue(
|
||||||
@ -80,11 +80,11 @@ testlib.test('shell exit does not shut down by default', function()
|
|||||||
end
|
end
|
||||||
end);
|
end);
|
||||||
|
|
||||||
testlib.test('shell exit shuts down when setting is enabled', function()
|
testlib.test('shell exit does not shut down when setting is disabled', function()
|
||||||
local calls = runStartupWithStubs({ ['trapos.shutdown_on_shell_exit'] = true });
|
local calls = runStartupWithStubs({ ['trapos.shutdown_on_shell_exit'] = false });
|
||||||
|
|
||||||
testlib.assertEquals(calls.shellRuns[1], 'shell');
|
testlib.assertEquals(calls.shellRuns[1], 'shell');
|
||||||
testlib.assertEquals(calls.shutdown, true);
|
testlib.assertEquals(calls.shutdown, false);
|
||||||
testlib.assertEquals(calls.rebooted, false);
|
testlib.assertEquals(calls.rebooted, false);
|
||||||
end);
|
end);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user