Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
GGELUA
GGELUA2
提交
c2980c50
GGELUA2
项目概览
GGELUA
/
GGELUA2
通知
169
Star
23
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
代码片段
项目成员
Pages
GGELUA2
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
c2980c50
编写于
4月 12, 2022
作者:
baidwwy
🏋
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复编译
上级
97749670
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
46 addition
and
35 deletion
+46
-35
build/base.lua
build/base.lua
+41
-30
build/build.lua
build/build.lua
+5
-5
未找到文件。
build/base.lua
浏览文件 @
c2980c50
-- @Author : GGELUA
-- @
Date : 2021-12-07 21:06:14
-- @
Last Modified by : GGELUA
-- @Last Modified time : 2022-0
2-13 14:59:44
-- @Author
: GGELUA
-- @
Last Modified by : baidwwy
-- @
Date : 2022-03-07 18:52:00
-- @Last Modified time : 2022-0
4-09 23:08:57
io.stdout
:
setvbuf
(
'no'
,
0
)
gge
=
package.loadlib
(
'ggelua'
,
'luaopen_ggelua'
)()
...
...
@@ -26,6 +26,7 @@ package.path = package.path .. ';.\\.vscode\\?.lua;.\\.ggelua\\?.lua'
--转换到绝对路径
local
function
绝对路径
(
path
,
...
)
assert
(
type
(
path
)
==
'string'
,
'路径错误:'
..
tostring
(
path
))
if
select
(
'#'
,
...
)
>
0
then
path
=
path
:
format
(
...
)
end
...
...
@@ -51,7 +52,7 @@ local function 绝对路径(path, ...)
end
local
function
分割文本
(
str
,
mark
)
if
str
then
if
type
(
str
)
==
'string'
then
local
r
=
{}
if
mark
==
'%'
then
mark
=
'([^'
..
mark
..
'%]+)'
...
...
@@ -70,48 +71,58 @@ local function 分割文本(str, mark)
end
function
创建目录
(
path
)
path
=
path
:
gsub
(
'\\'
,
'/'
):
match
(
'(.+)/'
)
path
=
分割文本
(
path
,
'/'
)
for
i
,
v
in
ipairs
(
path
)
do
lfs
.
mkdir
(
table.concat
(
path
,
'
\\
'
,
1
,
i
))
if
type
(
path
)
==
'string'
then
path
=
path
:
gsub
(
'\\'
,
'/'
):
match
(
'(.+)/'
)
path
=
分割文本
(
path
,
'/'
)
for
i
,
v
in
ipairs
(
path
)
do
lfs
.
mkdir
(
table.concat
(
path
,
'
\\
'
,
1
,
i
))
end
end
end
function
删除目录
(
path
,
all
)
path
=
绝对路径
(
path
):
gsub
(
'/'
,
'\\'
)
if
all
then
os.execute
(
'RMDIR /S /Q '
..
path
)
else
os.execute
(
'RMDIR /Q '
..
path
)
if
type
(
path
)
==
'string'
then
path
=
绝对路径
(
path
):
gsub
(
'/'
,
'\\'
)
if
all
then
os.execute
(
'RMDIR /S /Q '
..
path
)
else
os.execute
(
'RMDIR /Q '
..
path
)
end
end
end
function
判断文件
(
path
)
local
file
=
io.open
(
绝对路径
(
path
),
'rb'
)
if
file
then
file
:
close
()
return
true
if
type
(
path
)
==
'string'
then
local
file
=
io.open
(
绝对路径
(
path
),
'rb'
)
if
file
then
file
:
close
()
return
true
end
end
return
false
end
function
读取文件
(
path
)
local
file
=
io.open
(
绝对路径
(
path
),
'rb'
)
if
file
then
local
data
=
file
:
read
(
'a'
)
file
:
close
()
return
data
if
type
(
path
)
==
'string'
then
local
file
=
io.open
(
绝对路径
(
path
),
'rb'
)
if
file
then
local
data
=
file
:
read
(
'a'
)
file
:
close
()
return
data
end
end
end
function
写出文件
(
path
,
data
)
local
file
=
io.open
(
绝对路径
(
path
),
'wb'
)
if
file
then
file
:
write
(
data
)
file
:
close
()
return
true
else
print
(
'写出失败'
,
path
)
if
type
(
path
)
==
'string'
then
local
file
=
io.open
(
绝对路径
(
path
),
'wb'
)
if
file
then
file
:
write
(
data
)
file
:
close
()
return
true
else
print
(
'写出失败'
,
path
)
end
end
return
false
end
...
...
build/build.lua
浏览文件 @
c2980c50
-- @Author : GGELUA
-- @
Date : 2021-12-07 21:06:14
-- @
Last Modified by: baidwwy
-- @Last Modified time
: 2022-01-23 05:40:55
-- @Author
: GGELUA
-- @
Last Modified by : baidwwy
-- @
Date : 2022-03-07 18:52:00
-- @Last Modified time
: 2022-04-09 23:05:47
require
(
'build/base'
)
pcall
(
require
,
'ggebuild'
)
\ No newline at end of file
print
(
pcall
(
require
,
'ggebuild'
))
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录