add scripts for treewide mainProgram
This commit is contained in:
21
treewideMainProgram/list_missing_main_programs.sh
Executable file
21
treewideMainProgram/list_missing_main_programs.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p bash ripgrep nix
|
||||
|
||||
FILES_WITHOUT_MAINPROGRAM=$(rg --case-sensitive --files-without-match "mainProgram" -g 'default.nix' .)
|
||||
|
||||
trap "exit 0" SIGINT
|
||||
|
||||
for FILE in $FILES_WITHOUT_MAINPROGRAM; do
|
||||
PACKAGE=$(dirname "$FILE" | sed 's|^./||')
|
||||
echo "Building: $PACKAGE"
|
||||
|
||||
NIXPKGS_ALLOW_UNFREE=1 nix build ".#$PACKAGE" --impure || continue
|
||||
|
||||
if [ "$(find result/bin | wc -w)" == 1 ]; then
|
||||
echo "$PACKAGE: $(ls result/bin)" >> packages.txt
|
||||
elif [ "$(find result-bin/bin | wc -w)" == 1 ]; then
|
||||
echo "$PACKAGE: $(ls result-bin/bin)" >> packages.txt
|
||||
fi
|
||||
|
||||
rm result* || true
|
||||
done
|
||||
Reference in New Issue
Block a user