Skip to content

Instantly share code, notes, and snippets.

@avidas
Created November 15, 2017 23:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avidas/2f8cf49b46f221fb46c403225b7562da to your computer and use it in GitHub Desktop.
Save avidas/2f8cf49b46f221fb46c403225b7562da to your computer and use it in GitHub Desktop.
Shell script to update invoice refs
#!/bin/bash
from=(
FeeHelper
InvoiceCorrection
InvoiceReverser
InvoiceOpener
LineItemReverser
TaxHelper
VatHelper
LineItemGenerator
InvoiceFinalizer
)
to=(
FeeService
InvoiceCorrectionService
InvoiceReverserService
InvoiceOpenService
LineItemReverserService
TaxService
VatService
LineItemGenerationService
InvoiceFinalizerService
)
for index in ${!from[*]}; do
git grep "${from[$index]}" | cut -d':' -f1 | uniq | xargs sed -i "" "s/${from[$index]}/${to[$index]}/g";
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment