ecp5-program: Delete garbage
authorLas Safin <me@las.rs>
Tue, 5 Oct 2021 12:43:46 +0000 (12:43 +0000)
committerLas Safin <me@las.rs>
Tue, 5 Oct 2021 12:43:46 +0000 (12:43 +0000)
nix/ecp5-program.nix

index fdf6c6831b4949601bb00daf4cec8e0e5cc5a147..09ce21948b5e158461918aeba57e65b70d7a5d86 100644 (file)
@@ -12,10 +12,14 @@ writeShellScript "program-ecp5-libresoc" ''
   export PATH="${openocd}/bin:${pythonWithEnv}/bin:${trellis}/bin:${nextpnr}/bin:$PATH"
 
   dir="$(mktemp -d)"
-  cd "$dir"
+  pushd "$dir"
   echo "$dir"
 
   export PYTHONPATH="${../src/soc/litex/florent}:$PYTHONPATH"
 
   python ${../src/soc/litex/florent/versa_ecp5.py} --sys-clk-freq=55e6 --load-from ${libresoc-ecp5}
+
+  popd
+  rm -rf "$dir"
+  exit 0
 ''