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
--- | |
################ | |
# Build & Test # | |
################ | |
kind: pipeline | |
name: run_tests | |
steps: | |
# Run tests against React client app (with Jest) |
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
import glob | |
import os | |
import re | |
def run(): | |
renamer = re.compile('[^0-9a-zA-Z]+') | |
for path in glob.iglob('/your/dir/*'): | |
file_path, file_name = path.rsplit('/', 1) | |
os.rename(path, os.path.join(file_path, renamer.sub('_', file_name)) |