Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Fabric を使用して Django をデプロイしています (もちろん)。文字列を grep するローカル コマンドを実行できるようにしたいと考えています。結果が返された場合は、例外を発生させてデプロイを停止します。
何かのようなもの:
local('grep -r -n "\s console.log" .')
したがって、0 を超える結果が得られた場合は、進行を停止したいと考えています。
これを処理する最善の方法は何ですか?
次のように実行します。
with settings(warn_only=True): local('grep -r -n "\s console.log" .')
これにより、呼び出しがゼロ以外のものを返した場合に、Fabricがスクリプトの実行を中止するのを防ぎます。