kako-junです
好きな聖地は 高岡古城公園です
gitpのREADME.mdを下書くよー
いかにもパーソナルユースな例えの絵。うがーー
git-fool 行儀が悪い git-rude
gitp pull で全リポジトリという意味 一括pullだけでも使えるかも
gitp_config.json
全部checkout . 全部git status もできる
git-foobar は使わない。 環境は汚さない
gitp clone gitp remote add gitp config user gitp pull gitp push 全てのenabledなリポジトリに同じ動作を指定したことになる
gitp clone [repository name] gitp remote add [repository name] gitp config user [repository name] gitp pull [repository name] gitp push [repository name] 1つのenabledなリポジトリに同じ動作を指定したことになる
gitp [repository name] clone hoge gitp [repository name] pull origin master gitp [repository name] add -A gitp [repository name] commit -m update. gitp [repository name] push origin master
gitp [repository name] remote add public gitp [repository name] checkout . cdandで実行される
[repository name]として使えない言葉 clone、remote、config、pull、push、on、off、add、remove
gitp -a checkout . が便利
gitp -a status がすごく便利
全てのリポジトリに同じコマンドを実行する
[repository name]はタブで補完が効くので便利 末尾についてしまう/は自動的に消去される
README_ja.md
gitp
は、シンプルなコマンドラインツールです
カレントディレクトリにしか効果の及ばないコマンド(git
、yarn
など)を、カレントディレクトリを変更することなく実行します
Goで書かれているため、多くのOSで動作します
「カレントディレクトリを移動してからでなければ、実行できないコマンド」は多くあります
例えば、pwd
$ pwd
/media/removable/SD Card/current
$ pwd subdir/subsubdir
/media/removable/SD Card/current
cdand
を使うと、簡潔に書けます
$ cdand subdir/subsubdir pwd
/media/removable/SD Card/current/subdir/subsubdir
使わない場合、カレントディレクトリが変化してしまうため、戻るコマンドが必要になります
$ cd subdir/subsubdir; pwd
$ cd ../..
cdand
にPATHを通すことで、cd ../..
にお別れできます
-
Operating System
- macOS
- Linux
-
macOS: gohat.dmg
-
Linux (
chmod u+x cdand
required)- x64: gohat_amd64.tar.gz
- ARM: gohat_arm64.tar.gz
- Raspberry Pi: gohat_armv7l.tar.gz
$ go get github.com/kako-jun/gohat
$ gohat foo.sh
「なぜこれが便利なのか……?」の例を、以下に挙げます
$ cdand your/git/repository git status
$ cdand your/node/project yarn
つまり、実行ディレクトリを変えるオプションを、コマンドごとに覚える必要がなくなります
カレントディレクトリ以外で実行するオプションとして、
git
には-C
オプションがnode
には-prefix
、-cwd
オプションが
それぞれあります
でも覚えにくいです
$ (cd subdir/subsubdir; ls)
という書き方もあります
でも面倒です
cdand
ならば cd
と打ち、「あ……めんどいな……」と思ったら and
と打ち足せばイイだけです
その後、ディレクトリ名を打つ時には cd
と同じくTABでの補完が効くため、違和感なく高速に打てます
cdand
自身を入れ子にして呼べます
$ cdand subdir cdand .. ls
特にメリットはありませんが、可能です
ls -G
でも色はつきません
vim
は起動しますが、端末に表示されません
less
は起動しますが、ページ送りはできません
対話型コマンドも対話できず、結果がまとめて表示されます
例えば、
$ cdand subdir cat my_secrets.txt | grep treasure
と書いた場合、
$ cdand subdir cat my_secrets.txt
した結果をカレントディレクトリで
$ grep treasure
するという意味になります
パイプの場合、それでも特に結果は変わらないでしょう
しかし、リダイレクトの場合、結果が変わります
$ cdand subdir cat my_secrets.txt > my_will.txt
を実行すると、my_will.txt
が作られるのは subdir
内でなく、カレントディレクトリ内です
どうしても subdir
内に作りたい場合は
cat my_secrets.txt > my_will.txt
という内容の foo.sh
ファイルを作って subdir
内に置き、
$ cdand subdir foo.sh
とすれば可能です (あまり意味はない気もしますが……)
import "github.com/kako-jun/gohat/gohat-core"
gohat.Exec()
Pull Requestを歓迎します
gohat
をより便利にする機能の追加- より洗練されたGoでの書き方
- バグの発見、修正
- もっと良い英訳、日本語訳があると教えたい
など、アイデアを教えてください
kako-jun
https://github.com/kako-jun
- 📓 https://gist.github.com/kako-jun
- 🏠 https://llll-ll.com
- 🐦 https://twitter.com/kako_jun_42
This project is licensed under the MIT License.
See the LICENSE file for details.
- Go
- and you
README.md