no message
This commit is contained in:
parent
58128bd3d6
commit
3967ac8b87
5
.gitignore
vendored
5
.gitignore
vendored
@ -1,3 +1,6 @@
|
||||
laravel/.env
|
||||
vuepress/docs/.vuepress/dist/*
|
||||
vuepress/docs/
|
||||
vuepress/docs/.vuepress/
|
||||
vuepress/docs/.vuepress/dist/
|
||||
vuepress/node_modules/
|
||||
vuepress/build.log
|
||||
@ -39,7 +39,9 @@ class ArticleController
|
||||
$this->sKey = $aArg["key"] ?? '';
|
||||
$this->aConfig = $aArg["config"] ?? '';
|
||||
|
||||
if ($this->sCmd == "new") {
|
||||
if ($this->sCmd == "del") {
|
||||
$this->cmd_del();
|
||||
} else if ($this->sCmd == "new") {
|
||||
$this->cmd_new();
|
||||
} else {
|
||||
$sMsg = "未找到cmd的对应处理:".$this->sCmd;
|
||||
@ -65,6 +67,31 @@ class ArticleController
|
||||
|
||||
}
|
||||
|
||||
private function cmd_del()
|
||||
{
|
||||
$aCategory = $this->aConfig["category"] ?? ["⚠️ 未得到category"];
|
||||
|
||||
foreach ($aCategory as $sCategoryRow) {
|
||||
$sFileDir = "../../vuepress/docs/{$sCategoryRow}/";
|
||||
$sFileName = $this->sArticleCode.".md";
|
||||
$sFilePath = $sFileDir.$sFileName;
|
||||
|
||||
if (is_file($sFilePath) && file_exists($sFilePath)) {
|
||||
if (unlink($sFilePath)) {
|
||||
$this->aNewPath[] = $this->sArticleCode."删除成功";
|
||||
} else {
|
||||
$sMsg = '删除失败(可能是权限或被占用)';
|
||||
throw new \Exception($sMsg);
|
||||
}
|
||||
} else {
|
||||
$sMsg = '文件不存在或不是普通文件';
|
||||
throw new \Exception($sMsg);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private function _npmBuild()
|
||||
{
|
||||
$sVuePathNode = $_ENV['vue_path_node'];
|
||||
|
||||
@ -3,7 +3,7 @@ title: Markdown
|
||||
tags:
|
||||
- markdown
|
||||
createTime: 2025/10/19 17:47:57
|
||||
permalink: /blog/9mgaypxo/
|
||||
permalink: /jccp/markdown/
|
||||
---
|
||||
|
||||
## 标题H2
|
||||
|
||||
Loading…
Reference in New Issue
Block a user