Skip to content

Commit c378a3d

Browse files
committed
Add patch from @pieh to ensure it works with old gatsby-cli
1 parent 103c902 commit c378a3d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/gatsby-telemetry/src/telemetry.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,13 @@ export class AnalyticsTracker {
178178
process.env.INTERNAL_GATSBY_TELEMETRY_SESSION_ID =
179179
p.gatsbyTelemetrySessionId
180180
}
181+
} else if (!process.env.INTERNAL_GATSBY_TELEMETRY_SESSION_ID) {
182+
// in case older `gatsby-telemetry` already set `gatsbyTelemetrySessionId` property on process
183+
// but didn't set env var - let's make sure env var is set
184+
process.env.INTERNAL_GATSBY_TELEMETRY_SESSION_ID =
185+
p.gatsbyTelemetrySessionId
181186
}
187+
182188
return p.gatsbyTelemetrySessionId
183189
}
184190

0 commit comments

Comments
 (0)