From 1ce2d87a9a53e638f725d8c5a880156fa3fff673 Mon Sep 17 00:00:00 2001
From: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com>
Date: Wed, 3 Feb 2021 10:26:29 +0300
Subject: Removes Cross Env

Webpack released support for passing node-env as an argument, meaning we
 no longer need cross-env to define environment variables. Other usages
 of cross-env were also removed.

Signed-off-by: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com>
---
 src/index.tsx | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

(limited to 'src/index.tsx')

diff --git a/src/index.tsx b/src/index.tsx
index 9eea4ce..4bce5a4 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -11,12 +11,12 @@ if (process.env.NODE_ENV === "production") {
     Sentry.init({
         dsn: process.env.REACT_APP_SENTRY_DSN,
         tracesSampleRate: 0.25,
-        release: `forms-frontend@${process.env.REACT_APP_SHA}`,
+        release: `forms-frontend@${process.env.COMMIT_REF}`,
         environment: process.env.CONTEXT
     });
 
     // Set tag as PR number, "main", or if unavailable, "unknown"
-    const branch = process.env.REACT_APP_BRANCH ?? "unknown";
+    const branch = process.env.BRANCH ?? "unknown";
     const branch_name = branch.replace(RegExp("pull/|/head", "g"), "");
     Sentry.setTag(branch_name === "main" ? "branch" : "pull_request", branch_name);
 }
@@ -28,8 +28,8 @@ console.log(`   Environment: %c ${process.env.NODE_ENV} `, `padding: 2px; border
 console.log(`   Context: %c ${process.env.CONTEXT} `, `padding: 2px; border-radius: 5px; background-color: ${process.env.CONTEXT === "production" ? colors.success : colors.error}`);
 console.log(`   Location: %c ${document.location.pathname + document.location.search + document.location.hash} `, `padding: 2px; border-radius: 5px; background-color: ${colors.success}`);
 console.log(`   User Agent: %c ${navigator.userAgent} `, `padding: 2px; border-radius: 5px; background-color: ${colors.success}`);
-console.log(`   Branch: %c ${process.env.REACT_APP_BRANCH} `, `padding: 2px; border-radius: 5px; background-color: ${process.env.REACT_APP_BRANCH === "main" ? colors.success : colors.error}`);
-console.log(`   SHA: %c ${process.env.REACT_APP_SHA} `, `padding: 2px; border-radius: 5px; background-color: ${colors.success}`);
+console.log(`   Branch: %c ${process.env.BRANCH} `, `padding: 2px; border-radius: 5px; background-color: ${process.env.BRANCH === "main" ? colors.success : colors.error}`);
+console.log(`   SHA: %c ${process.env.COMMIT_REF} `, `padding: 2px; border-radius: 5px; background-color: ${colors.success}`);
 
 console.log("%cCome join us on Discord! https://discord.gg/python", `font-size: 1.5em; font-family: "Hind", "Arial"; color: ${colors.blurple}`);
 
-- 
cgit v1.2.3

