Created
November 15, 2017 23:26
-
-
Save avidas/2f8cf49b46f221fb46c403225b7562da to your computer and use it in GitHub Desktop.
Shell script to update invoice refs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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