maintainers/scripts/kde/collect-logs: rewrite in Nu
Fast.
This commit is contained in:
11
maintainers/scripts/kde/collect-logs.nu
Executable file
11
maintainers/scripts/kde/collect-logs.nu
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i nu -p nushell
|
||||
cd $"($env.FILE_PWD)/../../.."
|
||||
|
||||
mkdir logs
|
||||
nix-env -qaP -f . -A kdePackages --json --out-path | from json | values | par-each { |it|
|
||||
echo $"Processing ($it.pname)..."
|
||||
if "outputs" in $it {
|
||||
nix-store --read-log $it.outputs.out | save -f $"logs/($it.pname).log"
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p gnused jq
|
||||
set -eu
|
||||
cd "$(dirname "$(readlink -f "$0")")"/../../..
|
||||
|
||||
mkdir -p logs
|
||||
for name in $(nix-env -qaP -f . -A kdePackages --json | jq -r 'to_entries[] | .key' | sed s/kdePackages.//); do
|
||||
echo "Processing ${name}..."
|
||||
path=$(nix eval ".#kdePackages.${name}.outPath" --json --option warn-dirty false | jq -r)
|
||||
if [ -n "${path}" ]; then
|
||||
nix-store --read-log "${path}" > "logs/${name}.log" || true
|
||||
fi
|
||||
done
|
||||
Reference in New Issue
Block a user