1 Star 0 Fork 0

敬章 / AllBookBuilder

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
main.c 1.08 KB
一键复制 编辑 原始数据 按行查看 历史
敬章 提交于 2023-01-14 08:03 . Complete
/*
main.c
Achieve the AllBookBuilder
BeginnerC
*/
#include <stdio.h>
#include <stdlib.h>
#include <dirent.h>
#include <unistd.h>
#include "./moudle/build_website/build_website.h"
#include "./moudle/build_single_book/build_single_book.h"
#include "./moudle/file/file.h"
#include "./moudle/config/config.h"
int main(int argc, char *argv[])
{
Config *config = NULL;
char *target_path = NULL;
char *mdbook_path = NULL;
char *temp = NULL;
char *proc_path = NULL;
char config_path[NAME_MAX] = {};
if (2 != argc)
{
printf("Usage: AllBookBuilder [path]\n");
return -1;
}
proc_path = GetProcPath();
chdir(proc_path);
free(proc_path);
sprintf(config_path, "%s", ToAbsolutePath(DEFAULT_CONFIG_NAME));
config = LoadConfig(config_path);
mdbook_path = GetConfigValue(config, MDBOOK_PATH);
temp = ToAbsolutePath(mdbook_path);
sprintf(mdbook_path, "%s", temp);
free(temp);
target_path = ToAbsolutePath(argv[1]);
BuildWebsite(target_path, config);
free(target_path);
FreeConfig(config);
return 0;
}
1
https://gitee.com/IamBeginnerC/all-book-builder.git
git@gitee.com:IamBeginnerC/all-book-builder.git
IamBeginnerC
all-book-builder
AllBookBuilder
master

搜索帮助