diff --git a/devenv.nix b/devenv.nix
index aa005834dea55b05d2f477e54f046a8641f81481..d4dd371f0ca6110f5790c93753e76c3ab356fafc 100644
--- a/devenv.nix
+++ b/devenv.nix
@@ -148,7 +148,7 @@ if ! git commit -m "chore: release and publish to npm new version $NEXTVERSION"
   exit 1
 fi
 
-cd ''${BUILD_PATH}
+cd ''${BUILD_PATH} || exit 1
 
 OPTIONS=""
 if [ ! -f "${config.devenv.root}/.npmrc" ]; then
@@ -160,11 +160,10 @@ if [ ! -f "${config.devenv.root}/.npmrc" ]; then
   OPTIONS="--dry-run --no-git-checks"
 fi
 
-pnpm publish $OPTIONS --dry-run --access public
+pnpm publish $OPTIONS --access public
 exitcode=$?
-cd -
+cd - || exit 1
 
-set -x
 if [ -n "$OPTIONS" ] || [ $exitcode -ne 0 ]; then
   
   ## reset to last version