This commit is contained in:
陆柯 2021-02-15 10:27:26 +08:00
parent 08fdf3c3fa
commit 728dcb521e
4 changed files with 95 additions and 2 deletions

47
config-git.sh Executable file
View File

@ -0,0 +1,47 @@
#!/bin/bash
echo "---------------------------------------------"
read -p "User Name to show in git log (leave blank for no change) >>> " UserName
if [ $UserName ]
then
echo "git config --global user.name $UserName"
git config --global user.name $UserName
fi
echo "---------------------------------------------"
read -p "User Email to show in git log (leave blank for no change) >>> " UserEmail
if [ $UserEmail ]
then
echo "git config --global user.email $UserEmail"
git config --global user.email $UserEmail
fi
echo "---------------------------------------------"
echo "如果 git 远程服务器的 ssl 证书过期,或者使用了自颁发的证书,连接时会出现验证错误 Cannot verify local issuer"
read -p "Force connect even if ssl failed verification? (true or false, blank for no change) >> " HttpSslVerify
if [ $HttpSslVerify ]
then
echo "git config --global http.sslVerify $HttpSslVerify"
git config --global http.sslVerify $HttpSslVerify
fi
echo "---------------------------------------------"
read -p "Store credential in cache or store? (leave blank for no change) >> " CredentialHelper
if [ $CredentialHelper ]
then
echo "git config --global credential.helper $CredentialHelper"
git config --global credential.helper $CredentialHelper
fi
echo "---------------------------------------------"
read -p "Path to global gitignore file? (For example ~/.gitignore, leave blank for no change) >> " ExcludesFile
if [ $ExcludesFile ]
then
if [ -e $ExcludesFile ]
then
echo "git config --global core.excludesfile $ExcludesFile"
git config --global core.excludesfile $ExcludesFile
else
echo "File not exsit: $ExcludesFile"
fi
fi

View File

@ -10,44 +10,64 @@ else
read -p "Enter config source path (leave blank for /faronear/lib/sysconfig/home) >> " SourcePath
if [ ! $SourcePath ]
then
echo Use default source path: /faronear/lib/sysconfig/home
echo "Use default source path: /faronear/lib/sysconfig/home"
SourcePath=/faronear/lib/sysconfig/home
fi
fi
if [ ! -d $SourcePath ]
then
echo !!! Not existing $SourcePath, please try again
echo "!!! Not existing $SourcePath, please try again"
else
echo "Config home from $SourcePath"
echo "---------------------------------------------"
if [ -e ~/.emacs ]
then
mv ~/.emacs ~/.emacs.backup
fi
rm -fr ~/.emacs
ln -s $SourcePath/.emacs ~/
echo Linked ~/.emacs to $SourcePath/.emacs
echo "---------------------------------------------"
if [ -e ~/.emacs.lisp ]
then
mv ~/.emacs.lisp ~/.emacs.lisp.backup
fi
rm -fr ~/.emacs.lisp
ln -s $SourcePath/.emacs.lisp ~/
echo Linked ~/.emacs.lisp to $SourcePath/.emacs.lisp
echo "---------------------------------------------"
if [ -e ~/.bashrc ]
then
mv ~/.bashrc ~/.bashrc.backup
fi
rm -fr ~/.bashrc
ln -s $SourcePath/.bashrc ~/
echo Linked ~/.bashrc to $SourcePath/.bashrc
echo "---------------------------------------------"
if [ -e ~/.bash_profile ]
then
mv ~/.bash_profile ~/.bash_profile.backup
fi
rm -fr ~/.bash_profile
ln -s $SourcePath/.bash_profile ~/
echo Linked ~/.bash_profile to $SourcePath/.bash_profile
echo "---------------------------------------------"
if [ -e ~/.gitignore ]
then
mv ~/.gitignore ~/.gitignore.backup
fi
rm -fr ~/.gitignore
ln -s $SourcePath/.gitignore ~/
echo Linked ~/.gitignore to $SourcePath/.gitignore
echo "---------------------------------------------"
echo Executing ~/.bashrc
. ~/.bashrc
echo "^_^ Home Setting Complete"

4
config-mac.sh Normal file → Executable file
View File

@ -8,4 +8,8 @@ defaults write com.apple.Dock autohide-delay -float 0
defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES
# Don't create .DS_Store files
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE
# To enable: defaults delete com.apple.desktopservices DSDontWriteNetworkStores
killall Dock

22
home/.gitignore vendored Normal file
View File

@ -0,0 +1,22 @@
.DS_Store
Thumbs.db
node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
/test/unit/coverage/
/test/e2e/reports/
selenium-debug.log
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
/package-lock.json
# Microsoft Office temporary files
~$*