depot/third_party/nixpkgs/pkgs/games/npush/run.nix
Default email a8b1b57b85 Project import generated by Copybara.
GitOrigin-RevId: fc4148a47fa927319186061aa42633c8aa5777f1
2022-01-22 02:22:15 +01:00

31 lines
622 B
Nix

{ runtimeShell
, symlinkJoin
, writeShellScriptBin
, npush
}:
let
runScript = writeShellScriptBin "run-npush" ''
set -euo pipefail
CWD=$(pwd)
if [ -d "./levels" ]; then
echo "Directory ./levels found; skipping levelset copy"
else
echo "Directory ./levels not found; copying the official levelset to the current directory"
mkdir -p ./levels
cp ${npush}/share/npush/levels/* levels/
chmod 644 levels/*
fi
echo "Now calling npush"
exec "${npush}/bin/npush"
'';
in
symlinkJoin {
name = "run-npush-${npush.version}";
paths = [
npush
runScript
];
}