Skip to content

Commit 86e0523

Browse files
committed
Add submodule build-aux.
修改: ChangeLog 新文件: setup.cmd 新文件: setup.sh
1 parent 285c878 commit 86e0523

File tree

3 files changed

+101
-0
lines changed

3 files changed

+101
-0
lines changed

ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
2023-08-08 ChenPi11 <wushengwuxi-msctinoulk@outlook.com>
22

33
Add CMake buildsystem support.
4+
Add submodule 'build-aux'.
45

56
2023-08-07 ChenPi11 <wushengwuxi-msctinoulk@outlook.com>
67

setup.cmd

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
@echo off
2+
rem Setup a repository during individual development.
3+
rem
4+
rem This script requires git program in the PATH.
5+
6+
rem Copyright (C) 2023 The C++ Plus Project.
7+
rem
8+
rem This program is free software: you can redistribute it and/or modify
9+
rem it under the terms of the GNU Lesser General Public License as published by
10+
rem the Free Software Foundation; either version 3 of the License, or
11+
rem (at your option) any later version.
12+
rem
13+
rem This program is distributed in the hope that it will be useful,
14+
rem but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
rem GNU Lesser General Public License for more details.
17+
rem
18+
rem You should have received a copy of the GNU Lesser General Public License
19+
rem along with this program. If not, see <https://www.gnu.org/licenses/>.
20+
21+
rem Usage: setup.cmd
22+
23+
if exist .\build-aux (
24+
echo Success: '.\build-aux' is exists, please don't remove it, and you can develop this package normally.
25+
goto QUIT
26+
)
27+
28+
if exist ..\build-aux (
29+
echo Success: '..\build-aux' is exists, please don't remove it, and you can develop this package normally.
30+
goto QUIT
31+
)
32+
33+
echo Notice: '..\build-aux' for C++ Plus are not exists, cloning it......
34+
git clone https://github.com/cppp-project/build-aux
35+
if %errorlevel%==0 (
36+
echo Success: '.\build-aux' cloned successfully, please don't remove it, and you can develop this package normally.
37+
) else (
38+
echo Error: .\build-aux' cloned failed, you can clone it by yourself or copy it from C++ Plus release source package.
39+
echo Notice: try to run 'git clone https://github.com/cppp-project/build-aux'.
40+
)
41+
42+
:QUIT

setup.sh

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#!/usr/bin/env sh
2+
# Setup a repository during individual development.
3+
#
4+
# This script requires git program in the PATH.
5+
6+
# Copyright (C) 2023 The C++ Plus Project.
7+
#
8+
# This program is free software: you can redistribute it and/or modify
9+
# it under the terms of the GNU Lesser General Public License as published by
10+
# the Free Software Foundation; either version 3 of the License, or
11+
# (at your option) any later version.
12+
#
13+
# This program is distributed in the hope that it will be useful,
14+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
# GNU Lesser General Public License for more details.
17+
#
18+
# You should have received a copy of the GNU Lesser General Public License
19+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
20+
21+
# Usage: ./setup.sh
22+
#
23+
24+
# Usage: text_out [color_id] [level] [msg]
25+
text_out()
26+
{
27+
echo "\033[$1m$2: $3 \033[0m"
28+
}
29+
30+
# Usage: execute [command]
31+
execute()
32+
{
33+
text_out 94 "$1"
34+
$1
35+
return $?
36+
}
37+
38+
if test -d './build-aux'
39+
then
40+
text_out 32 "Success" "'./build-aux' is exists, please don't remove it, and you can develop this package normally."
41+
exit 0
42+
fi
43+
44+
if test -d '../build-aux'
45+
then
46+
text_out 32 "Success" "'../build-aux' is exists, please don't remove it, and you can develop this package normally."
47+
exit 0
48+
fi
49+
50+
text_out 0 "Notice" "'../build-aux' for C++ Plus are not exists, cloning it......"
51+
execute "git clone https://github.com/cppp-project/build-aux"
52+
if [ $? -eq 0 ]
53+
then
54+
text_out 32 "Success" "'./build-aux' cloned successfully, please don't remove it, and you can develop this package normally."
55+
else
56+
text_out 31 "Error" "'./build-aux' cloned failed, you can clone it by yourself or copy it from C++ Plus release source package."
57+
text_out 0 "Notice" "try to run 'git clone https://github.com/cppp-project/build-aux'. "
58+
fi

0 commit comments

Comments
 (0)