Skip to content

Commit c0671bd

Browse files
committed
Update cleanup script
1 parent c81e9af commit c0671bd

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

app/scripts/clean_data.py

+5-13
Original file line numberDiff line numberDiff line change
@@ -111,20 +111,17 @@ def main():
111111
'project_name': 'locales',
112112
}
113113
"""
114-
l10n_subfolders = {}
114+
l10n_subfolders = {
115+
"gecko_strings": "l10n",
116+
"thunderbird": "l10n",
117+
}
115118

116-
hg_path = config_parser.get("config", "local_hg")
117119
git_path = config_parser.get("config", "local_git")
118120

119121
need_cleanup = False
120122
for repository_id, repository in supported_repositories.items():
121-
# Check if the folder exists as a Mercurial repository. If it doesn't
122-
# assume it's a Git repository.
123123
print("--\nAnalyze: {}".format(repository_id))
124-
if os.path.isdir(os.path.join(hg_path, repository["folder_name"])):
125-
folder_path = os.path.join(hg_path, repository["folder_name"])
126-
else:
127-
folder_path = os.path.join(git_path, repository["folder_name"])
124+
folder_path = os.path.join(git_path, repository["folder_name"])
128125

129126
folder_path = os.path.join(folder_path, l10n_subfolders.get(repository_id, ""))
130127
if not os.path.isdir(folder_path):
@@ -146,11 +143,6 @@ def main():
146143
# This folder is inside the repository but doesn't match
147144
# any supported locale.
148145
print("{} is not a supported locale".format(folder))
149-
need_cleanup = True
150-
if args.delete:
151-
full_path = os.path.join(folder_path, folder)
152-
print("Removing folder: {}".format(full_path))
153-
shutil.rmtree(full_path)
154146
if not need_cleanup:
155147
print("Nothing to remove.")
156148

0 commit comments

Comments
 (0)