Skip to content

zhuddan/cmd-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cmd-Config

常用终端命令/别名的配置

命令/别名

  • d/dev
 d  # nr dev
 d a # nr dev:a
 d b # nr dev:b
 dev  # nr dev
 dev a # nr dev:a
 dev b # nr dev:b
  • w/watch
 w  # nr watch
 w a # nr watch:a
 w b # nr watch:b
 watch  # nr watch
 watch a # nr watch:a
 watch b # nr watch:b
  • t/test
 t  # nr test
 t a # nr test:a
 t b # nr test:b
 test  # nr test
 test a # nr test:a
 test b # nr test:b
  • b/build
 b  # nr build
 b a # nr build:a
 b b # nr build:b
 build  # nr build
 build a # nr build:a
 build b # nr build:b
  • s/server

Note

s/server命令会检查package.jsonserverstart脚本。 并且server的优先级更高。由于start是内置的命令,故别名为server。你可以手动修改Microsoft.Powerbash_profile.ps1调整优先级。

如果你的 package.json 只有 start 脚本

 s  # nr start
 s a # nr start:a
 s b # nr start:b
 server  # nr start
 server a # nr start:a
 server b # nr start:b

如果你的 package.jsonserver 脚本,此时 start 命令会被忽略。

 s  # nr server
 s a # nr server:a
 s b # nr server:b
 server  # nr server
 server a # nr server:a
 server b # nr server:b
  • hs (基于http-server的web服务容器,如需使用请先安装,可选参数path为服务路径)
 hs # http-server $output -c-0 --cors
 hs dist # http-server dist $output -c-0 --cors # 此时 http-server 入口为 dist
  • vs (使用vscode打开当前目录, 若存在package.json, 自动使用ni下载依赖)
 vs # vscode 打开当前目录并且自动下载依赖
  • g (git clone的简化操作, 参数repoUrl为仓库地址, 可选参数dir为克隆地址 )
g https://github.com/microsoft/TypeScript # git clone https://github.com/microsoft/TypeScript
g https://github.com/microsoft/TypeScript ts # git clone https://github.com/microsoft/TypeScript ts
  • go (git remote -v别名)
 go # git remote -v
  • cleanup Windows Only (删除所有node_modules依赖和依赖锁定文件package-lock.json, yarn.lockb, bun.lockb, .pnpm-lock.yaml)
 cleanup #  清理缓存
  • o (打开目录)
 o # start . / open .
 o a # start a / start a
  • cls -clear
 cls # clear
  • pub
pub # npm publish --access public
  • pubres
pubres # npm publish --access restricted
  • rec 重载配置
rec
# Mac: source ~/.zshrc 
# Windows: . $PROFILE

使用

mac

  1. 复制 .zshrc~/.zshrc 如果没有此文件请先创建

  2. 执行下面命令重载配置

source ~/.zshrc

windows

  1. 复制 Microsoft.PowerShell_profile.ps1的内容 到 你的配置文件内 即可 使用 vscode 打开你的配置
code $PROFILE

或者使用 txt 打开

notepad $PROFILE
  1. 复制Microsoft.PowerShell_profile.ps1内容到你的配置文件中并且保存。

  2. 保存之后需要重载你的配置

. $PROFILE

历史版本

参考

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors