2020-03-18 12:57:00 +01:00
|
|
|
{ stdenv, nixpkgs }:
|
2020-01-24 20:27:02 +01:00
|
|
|
|
|
|
|
with nixpkgs.buildPackages;
|
|
|
|
|
|
|
|
writeScriptBin "generate-manifest" ''
|
|
|
|
#!${runtimeShell}
|
|
|
|
root="$1"
|
|
|
|
if [ -z "$root" ]; then
|
|
|
|
echo a directory must be passed as an argument >> /dev/stderr
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
if [ ! -d "$root" ]; then
|
|
|
|
echo \'$root\' is not an existing directory >> /dev/stderr
|
|
|
|
exit 1
|
|
|
|
fi
|
2020-03-10 13:33:53 +01:00
|
|
|
|
2020-01-24 20:27:02 +01:00
|
|
|
set -eu
|
2020-03-10 13:33:53 +01:00
|
|
|
echo -n '['
|
|
|
|
find $root/ -type f -printf ',{mapKey= "%f",mapValue="%p"}'
|
|
|
|
echo -n ']'
|
2020-01-24 20:27:02 +01:00
|
|
|
''
|