0

I am using Fabric to deploy Django (of course). I want to be able to run a local command which greps a string, and if returns any results, raises an exception and halts deploy.

Something like:

local('grep -r -n "\s console.log" .')

So if I get > 0 results, I want to halt progress.

What is the best way to handle this?

vaultah
  • 44,105
  • 12
  • 114
  • 143
Darwin Tech
  • 18,449
  • 38
  • 112
  • 187

1 Answers1

2

Run it like this:

with settings(warn_only=True):
  local('grep -r -n "\s console.log" .')

This will prevent Fabric from aborting the script execution in case the call returns anything different to zero.

Michael Küller
  • 3,982
  • 4
  • 22
  • 42