sexy scripts
1.0.0
このリポジトリには、macOS / Linux での日常生活のためのスクリプトが含まれています。
Windows Bash や Cygwin でも動作させることができると思います。
このリポジトリのクローンを作成またはダウンロードし、(たとえば) 以下を使用して~/.zshrc
内の環境に追加します。
export PATH= " ${PATH} :/Users/phally/sexy-scripts "
指定されたフォルダーを監視し、何かが変更された場合に指定されたコマンドを実行します。
たとえば、テスト駆動開発 (TDD) や HTTP API 開発に非常に役立ちます。
リクエストを実行するたびにブラウザを更新したり、コマンドを再実行したり、Postman などに戻ったりする必要はありません。
xargs
使用するため、エイリアスはサポートされません。 Homebrew または Apt を使用してインストールできるfswatch
が必要です。
使用法:
watchdo < folder ... > -- < command >
例:
# Automatically run all PHPunit tests when you save something:
watchdo src -- vendor/bin/phpunit
# Automatically run a single PHPunit test when you save something:
watchdo src -- vendor/bin/phpunit tests/TestCase/Controller/UsersControllerTest.php
# Obviously useful for API development!
# Watch the source code and do a HTTP request on save (with HTTPie):
watchdo src -- http GET http://localhost:3000/project/items.json
# Run a command for the triggered file.
# Here {} is replaced by the full path of the changed file:
watchdo folder1 folder2 -- ls -lah {}
やがて、ここにさらにスクリプトを追加することになるでしょう。
これらのスクリプトはシンプルになるように設計されています。貢献には大変感謝していますが、より複雑になる問題やプル リクエストはクローズされる可能性があります。