一些工具的配置老是忘记,每次用到都要搜索,所以,写个 list 配置一下

  • npm

npm

设置 npm 淘宝镜像加速 ``` // 设置淘宝镜像 npm config set registry https://registry.npm.taobao.org // 查看配置 npm config list // 恢复配置,以便正常在 npm 登录,发布包等操作 npm config delete registry

setnpm() { if [ “$1” == “alibaba” ]; then echo “set npm to [alibaba]” npm config set registry http://registry.npm.alibaba-inc.com elif [ “$1” == “npm” ]; then echo “set npm to [npm]” npm config delete registry else echo “set npm to [taobao]” npm config set registry https://registry.npm.taobao.org fi

echo ""
echo "===== Current NPM Config ===="
echo ""

npm config list } ```

bash

# GIT
alias gs="git status"

gp() {
    if [ "$1" == "" ]; then
        git push
    else
        git push --set-upstream origin $1
    fi
}

gb() {
    git checkout -b "daily/$1"
}

commit() {
    echo "git add ."
    git add .

    if [ "$1" == "" ]; then
        echo "git commit -m 'Update Code'"
        git commit -m "Update Code"
    else
        echo "git commit -m '$1'"
        git commit -m "$1"
    fi
}

setnpm() {
    if [ "$1" == "alibaba" ]; then
        echo "set npm to [alibaba]"
        npm config set registry http://registry.npm.alibaba-inc.com
    elif [ "$1" == "npm" ]; then
        echo "set npm to [npm]"
        npm config delete registry
    else
        echo "set npm to [taobao]"
        npm config set registry https://registry.npm.taobao.org
    fi

    echo ""
    echo "===== Current NPM Config ===="
    echo ""

    npm config list
}