Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Merge pull request #13091 from brave/fix/#13089
Browse files Browse the repository at this point in the history
Fix promoCode Regex to include valid suffix
  • Loading branch information
bsclifton committed Feb 12, 2018
1 parent 034ced2 commit 6cd3cca
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/cmdLine.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const fs = require('fs')
const path = require('path')

const isDarwin = process.platform === 'darwin'
const promoCodeFilenameRegex = /-([a-zA-Z\d]{3}\d{3})$/g
const promoCodeFilenameRegex = /-([a-zA-Z\d]{3}\d{3})\s?(?:\(\d+\))?$/g
const debugTabEventsFlagName = '--debug-tab-events'

let appInitialized = false
Expand Down
2 changes: 1 addition & 1 deletion build/pkg-scripts/postinstall
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Extract a referral / promo code from the installer path of the format /dir/path/Setup-Brave-Anything-xxx001.pkg
# where the promo code would be xxx001
installerPath=$1
installerPathPromoCodeRegex='.+-([a-zA-Z0-9]{3}[0-9]{3})\.pkg$'
installerPathPromoCodeRegex='.+-([a-zA-Z0-9]{3}[0-9]{3})\s?(?:\([0-9]+\))?\.pkg$'
userDataDir="$HOME/Library/Application Support/brave"
promoCodePath="$userDataDir/promoCode"
# pkg runs this script as root so we need to get current username
Expand Down

0 comments on commit 6cd3cca

Please sign in to comment.