From 449c8b5f362835d75e5f98ccf89f99df5d7a2e88 Mon Sep 17 00:00:00 2001
From: Jarred Sumner <jarred@jarredsumner.com>
Date: Sun, 24 Oct 2021 06:18:42 -0700
Subject: [internal] Tweak build system to better support unit tests in Zig

---
 packages/bun-macro-relay/bun-macro-relay.tsx | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

(limited to 'packages/bun-macro-relay/bun-macro-relay.tsx')

diff --git a/packages/bun-macro-relay/bun-macro-relay.tsx b/packages/bun-macro-relay/bun-macro-relay.tsx
index 6c12c1f45..0dc42eace 100644
--- a/packages/bun-macro-relay/bun-macro-relay.tsx
+++ b/packages/bun-macro-relay/bun-macro-relay.tsx
@@ -10,12 +10,15 @@ import { parse, print } from "graphql";
 // 6. Replace the TemplateLiteral with the default identifier from the injected import
 let artifactDirectory: string = `__generated__`;
 
-if (process.env.RELAY_ARTIFACT_DIRECTORY) {
-  artifactDirectory = process.env.RELAY_ARTIFACT_DIRECTORY;
+const { RELAY_ARTIFACT_DIRECTORY, BUN_MACRO_RELAY_ARTIFACT_DIRECTORY } =
+  Bun.env;
+
+if (RELAY_ARTIFACT_DIRECTORY) {
+  artifactDirectory = RELAY_ARTIFACT_DIRECTORY;
 }
 
-if (process.env.BUN_MACRO_RELAY_ARTIFACT_DIRECTORY) {
-  artifactDirectory = process.env.BUN_MACRO_RELAY_ARTIFACT_DIRECTORY;
+if (BUN_MACRO_RELAY_ARTIFACT_DIRECTORY) {
+  artifactDirectory = BUN_MACRO_RELAY_ARTIFACT_DIRECTORY;
 }
 
 // TODO: platform-independent path cleaning
-- 
cgit v1.2.3

