mirror of
https://github.com/KanjiVG/kanjivg.git
synced 2026-04-22 21:40:41 +02:00
Improve the cleanup script
This commit is contained in:
19
clean.py
19
clean.py
@@ -5,11 +5,28 @@
|
||||
|
||||
import os, glob
|
||||
|
||||
badFiles = glob.glob('kanjivg.xml')
|
||||
# Print debugging information if set to a true value.
|
||||
|
||||
verbose = True
|
||||
|
||||
# These files are generated by updatepublic.sh but are not part of the
|
||||
# repository.
|
||||
|
||||
badFiles = glob.glob('kanjivg*.xml*')
|
||||
badFiles.extend(glob.glob('kanjivg*.zip'))
|
||||
for file in badFiles:
|
||||
if os.path.exists(file):
|
||||
if verbose:
|
||||
print("Removing %s" % (file) )
|
||||
os.remove(file)
|
||||
|
||||
# Emacs and possibly other editors create files with a ~ at the end
|
||||
# for backup purposes.
|
||||
|
||||
emacsBackups = glob.glob('kanji/*~')
|
||||
emacsBackups.extend(glob.glob('*~'))
|
||||
emacsBackups.extend(glob.glob('.git/*~'))
|
||||
for file in emacsBackups:
|
||||
if verbose:
|
||||
print("Removing %s" % (file) )
|
||||
os.remove(file)
|
||||
|
||||
Reference in New Issue
Block a user