build: add script that lists private packages in repository

This commit is contained in:
George Rawlinson 2021-07-25 03:35:39 +00:00
parent 69938d64ea
commit 98541def65
Signed by: grawlinson
GPG Key ID: E0959FEA8B550539
2 changed files with 33 additions and 0 deletions

29
.repo/list-private Executable file
View File

@ -0,0 +1,29 @@
#!/usr/bin/python
# Python version of the following shell script:
# find . -maxdepth 1 \
# -type d \
# -not -exec test -e "{}/.git" ';' \
# -not -path "*/\.*" \
# -print \
# | sed "s/\.\///g" \
# | sort
import os
forks = []
for item in os.listdir("."):
# skip hidden directories, files, and submodules
if (
not item.startswith(".")
and os.path.isdir(item)
and not os.path.isfile(f"{item}/.git")
):
forks.append(item)
# sort alphabetically
forks.sort()
for fork in forks:
print(fork)

View File

@ -48,3 +48,7 @@ help: ## Display this help
rewrite: ## Rewrite .gitmodules
@.repo/rewrite-gitmodules
.PHONY: list-private-packages
list-private: ## List private packages in repository
@.repo/list-private