This project has been archived. Please use the new repository: https://github.com/zhuddan/cmd-config
-
复制
Microsoft.PowerShell_profile.ps1的内容 到你的配置文件内即可使用
vscode打开你的配置code $PROFILE或者使用
txt打开notepad $PROFILE -
复制Microsoft.PowerShell_profile.ps1内容到你的配置文件中并且保存。
-
保存之后需要重载你的配置
. $PROFILE
然后你就可以愉快玩耍了, 记得重新开口终端窗口或者重载你的配置。
- 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.json的server 和 start脚本。 并且server的优先级更高。由于start是内置的命令,故别名为server。你可以手动修改Microsoft.PowerShell_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.json 有 server 脚本,此时 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 (删除所有
node_modules依赖和依赖锁定文件package-lock.json,yarn.lockb,bun.lockb,.pnpm-lock.yaml)
cleanup # 清理缓存- o (打开当前目录)
o # start .参考