Created
August 6, 2018 16:15
-
-
Save coderek/2f194c63ab06a8760b2473ab0d30f2b3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
from subprocess import run, DEVNULL | |
import re | |
cp = run(['ls', 'graphql'], stdout=PIPE, encoding='utf-8') | |
for filename in re.split(r'\s+', cp.stdout): | |
if filename: | |
cp = run( | |
'ack -w -r {filename} **/**'.format(filename=filename), | |
stdout=DEVNULL, | |
shell=True) | |
if cp.returncode == 1: | |
run(['rm', 'graphql/' + filename]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment