Allow running on non-kokoro machine.

Signed-off-by: Tim 'mithro' Ansell <tansell@google.com>
diff --git a/open_pdks/build-info.py b/open_pdks/build-info.py
index 5365cad..f8914e9 100755
--- a/open_pdks/build-info.py
+++ b/open_pdks/build-info.py
@@ -104,8 +104,8 @@
 Build artifacts @ https://console.cloud.google.com/storage/browser/open_pdks/skywater-pdk/artifacts/{KOKORO_BUILD_ARTIFACTS_SUBDIR}
 
 """.format(
-    KOKORO_BUILD_ID=os.environ['KOKORO_BUILD_ID'],
-    KOKORO_BUILD_ARTIFACTS_SUBDIR=os.environ['KOKORO_BUILD_ARTIFACTS_SUBDIR'],
+    KOKORO_BUILD_ID=os.environ.get('KOKORO_BUILD_ID', '???'),
+    KOKORO_BUILD_ARTIFACTS_SUBDIR=os.environ.get('KOKORO_BUILD_ARTIFACTS_SUBDIR', '???'),
     **version_strings)
 
 print(info)
diff --git a/open_pdks/run.sh b/open_pdks/run.sh
index 1a9bae9..51bf4f7 100755
--- a/open_pdks/run.sh
+++ b/open_pdks/run.sh
@@ -28,7 +28,11 @@
 
 set -e
 
-$SCRIPT_DIR/system-setup.sh
+if [ "$KOKORO_BUILD_ID" != "" ]; then
+	$SCRIPT_DIR/system-setup.sh
+else
+	sudo chown -R $UID $TOP_DIR
+fi
 
 mkdir -p out
 
@@ -48,9 +52,12 @@
 find $PWD -type d | sort
 
 set -xe
+set -o pipefail
 
-$SCRIPT_DIR/output-cleanup.sh
-$SCRIPT_DIR/output-start.sh
+if [ "$KOKORO_BUILD_ID" != "" ]; then
+	$SCRIPT_DIR/output-cleanup.sh
+	$SCRIPT_DIR/output-start.sh
+fi
 
 # This script tries to follows the instructions in the README @
 # https://github.com/RTimothyEdwards/open_pdks/tree/master/sky130 with a couple
@@ -137,9 +144,11 @@
 	fi
 	sudo rm -rf "$D"
 done
-sudo chown -R $UID /tmpfs/src
+sudo chown -R $UID $TOP_DIR
 
-# Copy into the output git repositories
-$SCRIPT_DIR/output-build.sh
-
-$SCRIPT_DIR/output-cleanup.sh
+if [ "$KOKORO_BUILD_ID" != "" ]; then
+	# Copy into the output git repositories
+	$SCRIPT_DIR/output-build.sh
+	# Cleanup the progress info
+	$SCRIPT_DIR/output-cleanup.sh
+fi