Allow skipping hidden and sorting
This commit is contained in:
parent
63902c079a
commit
2a0834734f
@ -2,6 +2,11 @@
|
||||
|
||||
The changelog was only added at version 0.0.4.
|
||||
|
||||
## 0.0.8
|
||||
|
||||
* Allow to ignore hidden directories with `--no-hidden`
|
||||
* Files and directories are now sorted during distribusification.
|
||||
|
||||
## 0.0.7
|
||||
|
||||
Let's think a bit about safety and robustness:
|
||||
|
@ -72,6 +72,11 @@ def build_argparser():
|
||||
help="Force whether distribusi overwrites or removes instances of index.html not generated by distribusi, use at own risk!",
|
||||
action="store_true")
|
||||
|
||||
parser.add_argument(
|
||||
'--no-hidden',
|
||||
help="Exclude hidden directories",
|
||||
action="store_true")
|
||||
|
||||
return parser
|
||||
|
||||
|
||||
|
@ -110,6 +110,13 @@ def distribusify(args, directory): # noqa
|
||||
print('Excluding directory:', ", ".join(args.exclude_directory))
|
||||
dirs[:] = [d for d in dirs if d not in args.exclude_directory]
|
||||
|
||||
if args.no_hidden:
|
||||
dirs = list(filter(lambda d: not d.startswith('.'), dirs))
|
||||
files = list(filter(lambda f: not f.startswith('.'), files))
|
||||
|
||||
dirs.sort()
|
||||
files.sort()
|
||||
|
||||
if not args.remove_index:
|
||||
html = []
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user