Skip to content

Commit

Permalink
Update build-github.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
elysia-best authored Mar 7, 2024
1 parent d6864ba commit 17dc5d5
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions build-github.sh
Original file line number Diff line number Diff line change
@@ -1,25 +1,35 @@
#!/bin/bash
set -e
script_dir=$(cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd)
source_dir=$source_dir

echo '欢迎使用灵墨OS自动编译脚本!'
echo '提示: 使用前请确认已经安装了所有必要的依赖。'

if test -e ~/LingmoOS
if test -e $source_dir
then
echo '存在同名的LingmoOS文件夹,正在删除...'
rm -rf ~/LingmoOS
rm -rf $source_dir
fi
echo '创建新的LingmoOS文件夹...'
mkdir ~/LingmoOS
mkdir $source_dir

function InstallDepends() {
echo '开始安装依赖'
apt install git devscripts equivs
git clone https://github.com/LingmoOS/LingmoOSBuildDeps.git
cd LingmoOSBuildDeps
mk-build-deps -i -t "apt-get -y" -r
}

# 定义一个函数来编译项目
function Compile() {
repo_name=$1
echo "开始编译 $repo_name ..."
cd ~/LingmoOS
cd $source_dir
if test -d $repo_name; then
echo "已存在 $repo_name 目录,更新中..."
cd $repo_name && git pull
cd $repo_name && git reset --hard HEAD && git pull
else
echo "正在克隆 $repo_name ..."
git clone https://github.com/LingmoOS/$repo_name.git
Expand All @@ -33,13 +43,6 @@ function Compile() {
# 在这里添加项目构建和编译命令
echo "$repo_name 编译完成"
}

echo '开始安装依赖'
apt install git devscripts equivs
git clone https://github.com/LingmoOS/LingmoOSBuildDeps.git
cd LingmoOSBuildDeps
mk-build-deps -i -t "apt-get -y" -r

REPOS="lingmo-screenlocker lingmo-settings lingmo-screenshots lingmo-cursor-themes lingmo-sddm-theme lingmo-appmotor lingmo-neofetch lingmo-daemon lingmo-ocr lingmo-terminal lingmo-gtk-themes LingmoUI lingmo-systemicons lingmo-wallpapers lingmo-debinstaller lingmo-calculator lingmo-system-build lingmo-windows-plugins lingmo-launcher lingmo-kwin lingmo-kernel lingmo-statusbar lingmo-qt-plugins lingmo-dock lingmo-system-core liblingmo lingmo-filemanager lingmo-core lingmo-texteditor lingmo-kwin-plugins lingmo-videoplayer"

# 列出所有项目供用户选择
Expand Down Expand Up @@ -79,6 +82,7 @@ all \
quit

do
InstallDepends
if [[ $project == "all" ]]; then
for repo in $REPOS; do
Compile $repo
Expand Down

0 comments on commit 17dc5d5

Please sign in to comment.