Skip to content

Commit 2d61883

Browse files
feat(resultsAppSetup): renamed all .stories.jsx files to .oldStories.tsx
1 parent a903ca7 commit 2d61883

File tree

9 files changed

+20
-0
lines changed

9 files changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import os
2+
import fnmatch
3+
4+
def change_file_extensions(root_dir):
5+
# Walk through all directories and files in the specified root directory
6+
for dirpath, dirnames, filenames in os.walk(root_dir):
7+
for filename in fnmatch.filter(filenames, '*.stories.jsx'):
8+
# Construct the full file path
9+
old_file_path = os.path.join(dirpath, filename)
10+
# Create the new file name by replacing the extension
11+
new_file_name = filename.replace('.stories.jsx', '.oldStories.tsx')
12+
new_file_path = os.path.join(dirpath, new_file_name)
13+
# Rename the file
14+
os.rename(old_file_path, new_file_path)
15+
print(f'Renamed: {old_file_path} to {new_file_path}')
16+
17+
if __name__ == "__main__":
18+
# Specify the root directory you want to start from
19+
root_directory = './' # Change this to your target directory
20+
change_file_extensions(root_directory)

0 commit comments

Comments
 (0)