diff --git a/config-git.sh b/config-git.sh new file mode 100755 index 0000000..09f6d54 --- /dev/null +++ b/config-git.sh @@ -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 diff --git a/config-home.sh b/config-home.sh index 0803700..2615acd 100755 --- a/config-home.sh +++ b/config-home.sh @@ -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" diff --git a/config-mac.sh b/config-mac.sh old mode 100644 new mode 100755 index a880005..bcf3b9b --- a/config-mac.sh +++ b/config-mac.sh @@ -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 diff --git a/home/.gitignore b/home/.gitignore new file mode 100644 index 0000000..92a7268 --- /dev/null +++ b/home/.gitignore @@ -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 +~$* +