at 24.05-pre 656 B view raw
1#!/usr/bin/env bash 2 3# This script lists all the optional command-line tools that diffoscope can use 4# (i.e. `diffoscope --list-tools`) but are missing from the Nix expression. 5 6diffoscope=$(nix-build --no-out-link -E 'with import ./. {}; diffoscope.override { enableBloat = true; }')/bin/diffoscope 7 8required=$($diffoscope --list-tools | \ 9 grep '^External-Tools-Required:' | \ 10 cut -d ' ' -f2- | \ 11 tr -d ,) 12 13# Uber-hacky! 14pathScript=$(cat $diffoscope | grep PATH) 15 16export PATH=$(nix-build --no-out-link -A which)/bin 17eval "$pathScript" 18 19for tool in $required; do 20 if ! which $tool >/dev/null 2>&1; then 21 echo $tool 22 fi 23done | sort