Skip to content

Commit

Permalink
Refactor and optimize the code
Browse files Browse the repository at this point in the history
  • Loading branch information
2moe committed Oct 10, 2020
1 parent 44f4660 commit 8cd10eb
Show file tree
Hide file tree
Showing 92 changed files with 10,915 additions and 7,221 deletions.
10 changes: 3 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,9 @@ recycle_bin.sh
233,sh
test.xml
LANG
locale
001
002
003
004
file.conf
aria2.session
.config/aria2_test.conf
test.md
README.md
server_test.sh
test/
test02.sh
4 changes: 0 additions & 4 deletions .mirror/gitee.sh

This file was deleted.

58 changes: 43 additions & 15 deletions .mirror/github.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,29 @@
#!/bin/bash
#!/usr/bin/bash
set -e
cd ..
ALL_SHELL_FILE=$(find ./* | grep sh | tr '\n' ' ' | cut -d '%' -f 1)
SHELL_FILE=$(find ./* | grep sh | tr '\n' ' ' | cut -d '%' -f 1)
ALL_SHARE_FILE=$(find ./share/* | tr '\n' ' ' | cut -d '%' -f 1)
unset ALL_SHELL_FILE
for i in ${SHELL_FILE}; do
if [ ! -d "${i}" ]; then
ALL_SHELL_FILE="${ALL_SHELL_FILE} ${i}"
fi
done
printf "%s\n" "$ALL_SHELL_FILE"
unset SHARE_FILE
for i in ${ALL_SHARE_FILE}; do
if [ ! -d "${i}" ]; then
SHARE_FILE="${SHARE_FILE} ${i}"
fi
done
printf "%s\n" "$SHARE_FILE"

#sed -i 's/zh_CN/en_US/g' ./*sh
INSTALL_FILE=./share/container/install
sed -i 's/zh_CN/en_US/g' ${ALL_SHELL_FILE}
sed -i 's/zh_CN/en_US/g' ./tools/gui/start*
sed -i 's/zh_CN/en_US/g' ${SHARE_FILE}
sed -i 's/zh_CN/en_US/g' ${INSTALL_FILE}
#sed -i 's@en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/@zh_CN.UTF-8 UTF-8/zh_CN.UTF-8 UTF-8/@' ./*sh tools/*/*
#########
#sed -i 's@en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/@zh_CN.UTF-8 UTF-8/zh_CN.UTF-8 UTF-8/@' ${ALL_SHELL_FILE}
Expand All @@ -11,30 +32,37 @@ sed -i 's/zh_CN/en_US/g' ${ALL_SHELL_FILE}
#sed -i 's@a\\\en_US.UTF-8 UTF-8@a\\\zh_CN.UTF-8 UTF-8@' tool.sh tools/*/*

#gentoo_lang
sed -i 's@en_US en_US@en_US zh_CN@g' install.sh
#sed -i 's@translation-update-en_US@translation-update-zh_CN@' install.sh
sed -i 's@en_US en_US@en_US zh_CN@g' ${INSTALL_FILE}
#sed -i 's@translation-update-en_US@translation-update-zh_CN@' ${INSTALL_FILE}
#sed -i 's@\^en_US@\^zh_CN@' tool.sh tools/*/*
#sed -i 's@\^en_US@\^zh_CN@' ${ALL_SHELL_FILE}

#sed -i 's@locale-gen en_US@locale-gen zh_CN@g' ./*sh tools/*/*

sed -i 's/114.114.114.114/1.0.0.1/' install.sh
sed -i 's/240c::6666/2606:4700:4700::1111/' install.sh
sed -i 's/114.114.114.114/1.0.0.1/' ${INSTALL_FILE}
sed -i 's/240c::6666/2606:4700:4700::1111/' ${INSTALL_FILE}
sed -i '[email protected]/mo2/[email protected]/Aloxaf/fzf-tab@g' zsh.sh
sed -i '[email protected]/mirrors/neofetch/raw/master/[email protected]/dylanaraps/neofetch/master/neofetch@g' install.sh zsh.sh
sed -i '[email protected]/mirrors/oh-my-zsh/raw/master/templates/[email protected]/ohmyzsh/ohmyzsh/master/templates/zshrc.zsh-template@g' install.sh zsh.sh
sed -i '[email protected]/mirrors/[email protected]/ohmyzsh/ohmyzsh.git@g' install.sh zsh.sh
sed -i '[email protected]/mirrors/neofetch/raw/master/[email protected]/dylanaraps/neofetch/master/neofetch@g' ${INSTALL_FILE} zsh.sh
sed -i '[email protected]/mirrors/oh-my-zsh/raw/master/templates/[email protected]/ohmyzsh/ohmyzsh/master/templates/zshrc.zsh-template@g' ${INSTALL_FILE} zsh.sh
sed -i '[email protected]/mirrors/[email protected]/ohmyzsh/ohmyzsh.git@g' ${INSTALL_FILE} zsh.sh
#sed -i '[email protected]/mo2/zsh/raw/master/@raw.githubusercontent.com/2moe/tmoe-zsh/master/@g' ./*sh
sed -i '[email protected]/mo2/zsh/raw/master/@raw.githubusercontent.com/2moe/tmoe-zsh/master/@g' ${ALL_SHELL_FILE}
sed -i '[email protected]/mo2/zsh/raw/master/@raw.githubusercontent.com/2moe/tmoe-zsh/master/@g' ${SHARE_FILE}

sed -i '[email protected]/mo2/linux/raw/master/@raw.githubusercontent.com/2moe/tmoe-linux/master/@g' ${ALL_SHELL_FILE}
sed -i '[email protected]/mo2/linux/raw/master/@raw.githubusercontent.com/2moe/tmoe-linux/master/@g' ${SHARE_FILE}

sed -i '[email protected]/mo2/[email protected]/2moe/tmoe-linux.git@g' ${SHARE_FILE}
sed -i '[email protected]/mo2/[email protected]/2moe/tmoe-linux.git@g' ${ALL_SHELL_FILE}
sed -i '/正在配置中文环境/d' install.sh
sed -i 's@###tmoe-github@@' install.sh zsh.sh

sed -i '/正在配置中文环境/d' ${INSTALL_FILE}
sed -i 's@###tmoe-github@@' ${INSTALL_FILE} zsh.sh
#sed -i '[email protected]/mo2/linux/raw/master/@raw.githubusercontent.com/2moe/tmoe-linux/master/@g' ./*sh ./tool/*sh tools/*/* tools/environment.sh

sed -i "s@URL='gitee.com/mo2/linux'@URL='github.com/2moe/tmoe-linux'@" ${ALL_SHELL_FILE}
sed -i '[email protected]/mo2/linux\"@github.com/2moe/tmoe-linux\"@' ${ALL_SHELL_FILE}
sed -i '[email protected]/mo2/linux\"@github.com/2moe/tmoe-linux\"@' ${SHARE_FILE}
sed -i 's@https://gitee.com/mo2/linux/issues@https://github.com/2moe/tmoe-linux/issues@g' manager.sh
sed -i '[email protected]/romkatv/[email protected]/romkatv/powerlevel10k@g' install.sh zsh.sh
sed -i '[email protected]/mo2/[email protected]/zsh-users/zsh-syntax-highlighting@g' install.sh zsh.sh
sed -i '[email protected]/mo2/[email protected]/zsh-users/zsh-autosuggestions@g' install.sh zsh.sh
sed -i '[email protected]/romkatv/[email protected]/romkatv/powerlevel10k@g' ${INSTALL_FILE} zsh.sh
sed -i '[email protected]/mo2/[email protected]/zsh-users/zsh-syntax-highlighting@g' ${INSTALL_FILE} zsh.sh
sed -i '[email protected]/mo2/[email protected]/zsh-users/zsh-autosuggestions@g' ${INSTALL_FILE} zsh.sh
#sed -i '[email protected]/mo2/[email protected]/2moe/tmoe-linux@g' ./*sh ./tool/*sh tools/*/*
4 changes: 2 additions & 2 deletions .mirror/move.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cd ~/gitee/linux
cp -r debian.sh install.sh tool.sh zsh.sh manager.sh Licenses .mirror tools .config ~/github/github-linux
cp -r .gitignore debian.sh install.sh tool.sh zsh.sh manager.sh Licenses share .mirror tools .config ~/github/github-linux
cd ~/github/github-linux/.mirror
./github.sh
#echo 'git commit -am '
#printf '%s\n' 'git commit -am '
code ~/github/github-linux
Loading

0 comments on commit 8cd10eb

Please sign in to comment.