Created
September 19, 2022 22:33
-
-
Save y-mamanaranu/3e205cd03dca092d186a7fb1205b1e9e to your computer and use it in GitHub Desktop.
Make code and code-insiders automatically switch based on directory.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function code(){ | |
| target="$(pwd)" | |
| if [[ -n "$1" ]]; then | |
| if [[ "$1" =~ "/*" ]]; then | |
| target="$1" | |
| else | |
| target="$(builtin cd $1; pwd)" | |
| fi | |
| fi | |
| if [[ "$target" =~ "$(ghq root)/github.com/y-muen/*" ]]; then | |
| command code-insiders $@ | |
| else | |
| command code $@ | |
| fi | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
CodeにはGitHubの仕事アカウント、Code InsiderにはGitHubのプライベートアカウントで入るとかの時に。
ソースをghqで管理すれば、これで必要最低限の認識はするはず?