From 98541def6555c29f93a4c0ab3a41cd0b3e032337 Mon Sep 17 00:00:00 2001 From: George Rawlinson Date: Sun, 25 Jul 2021 03:35:39 +0000 Subject: [PATCH] build: add script that lists private packages in repository --- .repo/list-private | 29 +++++++++++++++++++++++++++++ Makefile | 4 ++++ 2 files changed, 33 insertions(+) create mode 100755 .repo/list-private diff --git a/.repo/list-private b/.repo/list-private new file mode 100755 index 0000000..84be31e --- /dev/null +++ b/.repo/list-private @@ -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) diff --git a/Makefile b/Makefile index ba69e49..d09b315 100644 --- a/Makefile +++ b/Makefile @@ -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 +