Skip to content

Commit

Permalink
Try adding sitehash to success event (#28136)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamo committed Nov 17, 2020
1 parent 088eef4 commit 6858f22
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/create-gatsby/src/index.ts
Expand Up @@ -17,6 +17,8 @@ import crypto from "crypto"
const sha256 = (str: string): string =>
crypto.createHash(`sha256`).update(str).digest(`hex`)

const md5 = (str: string): string =>
crypto.createHash(`md5`).update(str).digest(`hex`)
/**
* Hide string on windows (for emojis)
*/
Expand Down Expand Up @@ -329,7 +331,8 @@ ${c.bold(`Thanks! Here's what we'll now do:`)}
${c.blueBright(`https://www.gatsbyjs.com/docs/gatsby-cli/`)}
`)

trackCli(`CREATE_GATSBY_SUCCESS`)
const siteHash = md5(path.resolve(data.project))
trackCli(`CREATE_GATSBY_SUCCESS`, { siteHash })
}

process.on(`exit`, exitCode => {
Expand Down
1 change: 1 addition & 0 deletions packages/create-gatsby/src/tracking.ts
Expand Up @@ -23,6 +23,7 @@ export interface ITrackCliArgs {
valueString?: string
exitCode?: number
valueStringArray?: Array<string>
siteHash?: string
}

export const trackCli = (eventType: string, args?: ITrackCliArgs): void => {
Expand Down

0 comments on commit 6858f22

Please sign in to comment.