feat: add pre set environment variables
This commit is contained in:
parent
0abefb4054
commit
08ab7704c1
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,4 +3,5 @@
|
||||
_*
|
||||
|
||||
!.gitignore
|
||||
!.init
|
||||
data
|
21
alias.d/.init
Executable file
21
alias.d/.init
Executable file
@ -0,0 +1,21 @@
|
||||
#!env zsh
|
||||
# shellcheck shell=ksh
|
||||
|
||||
|
||||
# 解决 zsh 一些指令错误匹配的问题
|
||||
setopt no_nomatch
|
||||
|
||||
# 遍历
|
||||
# for item in `ls ~/alias.d/*.sh`; do
|
||||
# source $item
|
||||
# done
|
||||
export AHome="$HOME"/alias.d
|
||||
for ali in "$AHome"/*.sh
|
||||
do
|
||||
[[ -e "$ali" ]] || break # 无 alias 停止
|
||||
source "$ali"
|
||||
done
|
||||
|
||||
# 等价于⬇️
|
||||
# source ~/alias.d/dev.sh
|
||||
# source ~/alias.d/docker.sh
|
23
alias.d/dev.sh
Executable file
23
alias.d/dev.sh
Executable file
@ -0,0 +1,23 @@
|
||||
# shellcheck shell=ksh
|
||||
|
||||
###
|
||||
# pnpm
|
||||
###
|
||||
export PNPM_HOME="$HOME/Library/pnpm"
|
||||
export PATH="$PNPM_HOME:$PATH"
|
||||
###
|
||||
|
||||
|
||||
###
|
||||
# nvm
|
||||
###
|
||||
export NVM_DIR="$HOME/.nvm"
|
||||
[ -s "/usr/local/opt/nvm/nvm.sh" ] && \. "/usr/local/opt/nvm/nvm.sh" # This loads nvm
|
||||
[ -s "/usr/local/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/usr/local/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion
|
||||
###
|
||||
|
||||
###
|
||||
# java
|
||||
###
|
||||
export JAVA_HOME=/Applications/Jetbrains/GoLand.app/Contents/jbr/Contents/Home
|
||||
###
|
18
alias.d/docker.sh
Executable file
18
alias.d/docker.sh
Executable file
@ -0,0 +1,18 @@
|
||||
# shellcheck shell=ksh
|
||||
|
||||
# docker 快捷指令
|
||||
# alias docker='_ docker'
|
||||
alias dc='docker container'
|
||||
alias di='docker image'
|
||||
alias dcl='dc logs -f -n 100 '
|
||||
alias dcrun='docker exec -it '
|
||||
alias dtmp='docker run -it --rm'
|
||||
|
||||
alias dp='docker compose'
|
||||
alias dpup='dp up -d --force-recreate'
|
||||
|
||||
alias ds='docker ps -a --format "table{{.Names}}\t{{.Status}}"'
|
||||
alias dsp='docker ps -a --format "table{{.Names}}\t{{.Status}}\t{{.Ports}}"'
|
||||
|
||||
alias dps='dp ps -a'
|
||||
alias dcp='docker cp'
|
38
alias.d/pkg.sh
Normal file
38
alias.d/pkg.sh
Normal file
@ -0,0 +1,38 @@
|
||||
# shellcheck shell=ksh
|
||||
|
||||
# 本机包管理器快捷方式
|
||||
alias pkg="brew"
|
||||
alias sea="pkg search "
|
||||
alias ins="pkg install -y "
|
||||
alias ser='pkg services'
|
||||
|
||||
# pm2 守护线程
|
||||
alias pmstart='pm2 start '
|
||||
alias pmdown='pm2 del '
|
||||
alias pmstop='pm2 stop '
|
||||
|
||||
alias pmr='pm2 restart '
|
||||
alias pml='pm2 log --lines 100 '
|
||||
|
||||
# 重启 pm2 服务配置
|
||||
alias pmrr='pm2 resurrect'
|
||||
|
||||
pmup() {
|
||||
_worker_name=$1
|
||||
pms "$_worker_name" && pml "$_worker_name"
|
||||
}
|
||||
|
||||
pmrun() {
|
||||
_cmd=$1
|
||||
_name=$2
|
||||
if [ -n "$_name" ]; then
|
||||
pmst -x "$_cmd" --name "$_name"
|
||||
else
|
||||
pmst -x "$_cmd"
|
||||
fi
|
||||
}
|
||||
|
||||
pms() {
|
||||
_worker_name=$1
|
||||
pmr "$_worker_name" && pml "$_worker_name"
|
||||
}
|
Loading…
Reference in New Issue
Block a user