mirror of
https://github.com/Leonmmcoset/CMLeonOS.git
synced 2026-04-21 19:24:00 +00:00
boom命令
This commit is contained in:
@@ -1 +1 @@
|
|||||||
2026-03-20 22:07:06
|
2026-03-21 23:18:24
|
||||||
@@ -1 +1 @@
|
|||||||
f5b8faa
|
ca30113
|
||||||
@@ -112,6 +112,8 @@ namespace CMLeonOS
|
|||||||
|
|
||||||
// 显示可用空间(动态单位)
|
// 显示可用空间(动态单位)
|
||||||
var available_space = fs.GetAvailableFreeSpace(@"0:\");
|
var available_space = fs.GetAvailableFreeSpace(@"0:\");
|
||||||
|
_logger.Info("Kernel", "Getting available free space");
|
||||||
|
|
||||||
string spaceWithUnit = FormatBytes(available_space);
|
string spaceWithUnit = FormatBytes(available_space);
|
||||||
_logger.Info("Kernel", $"Available Free Space: {spaceWithUnit}");
|
_logger.Info("Kernel", $"Available Free Space: {spaceWithUnit}");
|
||||||
|
|
||||||
@@ -121,6 +123,7 @@ namespace CMLeonOS
|
|||||||
|
|
||||||
// 检查并创建system文件夹
|
// 检查并创建system文件夹
|
||||||
string systemFolderPath = @"0:\system";
|
string systemFolderPath = @"0:\system";
|
||||||
|
_logger.Info("Kernel", $"Checking for system folder at {systemFolderPath}");
|
||||||
if (!System.IO.Directory.Exists(systemFolderPath))
|
if (!System.IO.Directory.Exists(systemFolderPath))
|
||||||
{
|
{
|
||||||
System.IO.Directory.CreateDirectory(systemFolderPath);
|
System.IO.Directory.CreateDirectory(systemFolderPath);
|
||||||
@@ -129,6 +132,7 @@ namespace CMLeonOS
|
|||||||
|
|
||||||
// 检查并创建apps文件夹
|
// 检查并创建apps文件夹
|
||||||
string appsFolderPath = @"0:\apps";
|
string appsFolderPath = @"0:\apps";
|
||||||
|
_logger.Info("Kernel", $"Checking for apps folder at {appsFolderPath}");
|
||||||
if (!System.IO.Directory.Exists(appsFolderPath))
|
if (!System.IO.Directory.Exists(appsFolderPath))
|
||||||
{
|
{
|
||||||
System.IO.Directory.CreateDirectory(appsFolderPath);
|
System.IO.Directory.CreateDirectory(appsFolderPath);
|
||||||
|
|||||||
@@ -74,8 +74,11 @@ namespace CMLeonOS
|
|||||||
{
|
{
|
||||||
// 清空用户列表并重新加载
|
// 清空用户列表并重新加载
|
||||||
users = null;
|
users = null;
|
||||||
|
_logger.Info("UserSystem", "Initializing user system...");
|
||||||
var tempUserSystem = new UserSystem();
|
var tempUserSystem = new UserSystem();
|
||||||
|
_logger.Info("UserSystem", "Loading user data...");
|
||||||
tempUserSystem.LoadUsers();
|
tempUserSystem.LoadUsers();
|
||||||
|
_logger.Info("UserSystem", "User data loaded successfully.");
|
||||||
initialized = true;
|
initialized = true;
|
||||||
_logger.Info("UserSystem", $"User system initialized. Loaded {users?.Count ?? 0} users.");
|
_logger.Info("UserSystem", $"User system initialized. Loaded {users?.Count ?? 0} users.");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -844,6 +844,18 @@ exportbackground 0:\mywallpaper.bmp
|
|||||||
beep
|
beep
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### boom
|
||||||
|
触发系统崩溃(用于测试)。
|
||||||
|
|
||||||
|
**用法:**
|
||||||
|
```bash
|
||||||
|
boom
|
||||||
|
```
|
||||||
|
|
||||||
|
**说明:**
|
||||||
|
- 此命令会抛出BoomCommandCrash异常
|
||||||
|
- 仅用于测试和调试目的
|
||||||
|
|
||||||
### cal
|
### cal
|
||||||
显示日历。
|
显示日历。
|
||||||
|
|
||||||
|
|||||||
@@ -239,6 +239,9 @@ namespace CMLeonOS.shell
|
|||||||
case "femboy":
|
case "femboy":
|
||||||
shell.ProcessFemboy();
|
shell.ProcessFemboy();
|
||||||
break;
|
break;
|
||||||
|
case "boom":
|
||||||
|
shell.ProcessBoom();
|
||||||
|
break;
|
||||||
case "alias":
|
case "alias":
|
||||||
shell.ProcessAlias(args);
|
shell.ProcessAlias(args);
|
||||||
break;
|
break;
|
||||||
|
|||||||
35
shell/Commands/Utility/BoomCommand.cs
Normal file
35
shell/Commands/Utility/BoomCommand.cs
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
// The CMLeonOS Project (https://github.com/Leonmmcoset/CMLeonOS)
|
||||||
|
// Copyright (C) 2025-present LeonOS 2 Developer Team
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace CMLeonOS.Commands.Utility
|
||||||
|
{
|
||||||
|
public class BoomCommandCrash : Exception
|
||||||
|
{
|
||||||
|
public BoomCommandCrash() : base("Boom! The boom command was executed!")
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class BoomCommand
|
||||||
|
{
|
||||||
|
public static void ProcessBoom()
|
||||||
|
{
|
||||||
|
throw new BoomCommandCrash();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -632,6 +632,11 @@ namespace CMLeonOS
|
|||||||
Commands.Utility.FemboyCommand.ProcessFemboy();
|
Commands.Utility.FemboyCommand.ProcessFemboy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ProcessBoom()
|
||||||
|
{
|
||||||
|
Commands.Utility.BoomCommand.ProcessBoom();
|
||||||
|
}
|
||||||
|
|
||||||
public void ChangePrompt(string args)
|
public void ChangePrompt(string args)
|
||||||
{
|
{
|
||||||
Commands.Utility.PromptCommand.ChangePrompt(args, ref prompt);
|
Commands.Utility.PromptCommand.ChangePrompt(args, ref prompt);
|
||||||
|
|||||||
Reference in New Issue
Block a user