diff options
author | brunobar79 <brunobar79@gmail.com> | 2018-10-17 02:01:54 +0800 |
---|---|---|
committer | brunobar79 <brunobar79@gmail.com> | 2018-10-17 02:01:54 +0800 |
commit | 13820b6cc1801a420f39cdfecd7ccb5309dc597b (patch) | |
tree | c79832d7077ab03e0afe0c322cb32b204865d8b5 /development | |
parent | eeecee01540fbad50c4c463a3b1a54142a63f168 (diff) | |
parent | 07ab613d4c647e3fe554bc06eab8cfb833315a88 (diff) | |
download | tangerine-wallet-browser-13820b6cc1801a420f39cdfecd7ccb5309dc597b.tar tangerine-wallet-browser-13820b6cc1801a420f39cdfecd7ccb5309dc597b.tar.gz tangerine-wallet-browser-13820b6cc1801a420f39cdfecd7ccb5309dc597b.tar.bz2 tangerine-wallet-browser-13820b6cc1801a420f39cdfecd7ccb5309dc597b.tar.lz tangerine-wallet-browser-13820b6cc1801a420f39cdfecd7ccb5309dc597b.tar.xz tangerine-wallet-browser-13820b6cc1801a420f39cdfecd7ccb5309dc597b.tar.zst tangerine-wallet-browser-13820b6cc1801a420f39cdfecd7ccb5309dc597b.zip |
fix conflicts
Diffstat (limited to 'development')
-rw-r--r-- | development/sentry-publish.js | 38 | ||||
-rw-r--r-- | development/verify-locale-strings.js | 5 |
2 files changed, 27 insertions, 16 deletions
diff --git a/development/sentry-publish.js b/development/sentry-publish.js index 7a6d55115..e14f3f176 100644 --- a/development/sentry-publish.js +++ b/development/sentry-publish.js @@ -14,21 +14,27 @@ async function start () { const versionAlreadyExists = await checkIfVersionExists() // abort if versions exists if (versionAlreadyExists) { - console.log(`Version "${VERSION}" already exists on Sentry, aborting sourcemap upload.`) - return + console.log(`Version "${VERSION}" already exists on Sentry, skipping version creation`) + } else { + // create sentry release + console.log(`creating Sentry release for "${VERSION}"...`) + await exec(`sentry-cli releases --org 'metamask' --project 'metamask' new ${VERSION}`) + console.log(`removing any existing files from Sentry release "${VERSION}"...`) + await exec(`sentry-cli releases --org 'metamask' --project 'metamask' files ${VERSION} delete --all`) } - // create sentry release - console.log(`creating Sentry release for "${VERSION}"...`) - await exec(`sentry-cli releases --org 'metamask' --project 'metamask' new ${VERSION}`) - console.log(`removing any existing files from Sentry release "${VERSION}"...`) - await exec(`sentry-cli releases --org 'metamask' --project 'metamask' files ${VERSION} delete --all`) - // upload sentry source and sourcemaps - console.log(`uploading source files Sentry release "${VERSION}"...`) - await exec(`for FILEPATH in ./dist/chrome/*.js; do [ -e $FILEPATH ] || continue; export FILE=\`basename $FILEPATH\` && echo uploading $FILE && sentry-cli releases --org 'metamask' --project 'metamask' files ${VERSION} upload $FILEPATH metamask/$FILE; done;`) - console.log(`uploading sourcemaps Sentry release "${VERSION}"...`) - await exec(`sentry-cli releases --org 'metamask' --project 'metamask' files ${VERSION} upload-sourcemaps ./dist/sourcemaps/ --url-prefix 'sourcemaps'`) - console.log('all done!') + // check if version has artifacts or not + const versionHasArtifacts = versionAlreadyExists && await checkIfVersionHasArtifacts() + if (!versionHasArtifacts) { + // upload sentry source and sourcemaps + console.log(`uploading source files Sentry release "${VERSION}"...`) + await exec(`for FILEPATH in ./dist/chrome/*.js; do [ -e $FILEPATH ] || continue; export FILE=\`basename $FILEPATH\` && echo uploading $FILE && sentry-cli releases --org 'metamask' --project 'metamask' files ${VERSION} upload $FILEPATH metamask/$FILE; done;`) + console.log(`uploading sourcemaps Sentry release "${VERSION}"...`) + await exec(`sentry-cli releases --org 'metamask' --project 'metamask' files ${VERSION} upload-sourcemaps ./dist/sourcemaps/ --url-prefix 'sourcemaps'`) + console.log('all done!') + } else { + console.log(`Version "${VERSION}" already has artifacts on Sentry, skipping sourcemap upload`) + } } async function checkIfAuthWorks () { @@ -45,6 +51,12 @@ async function checkIfVersionExists () { return versionAlreadyExists } +async function checkIfVersionHasArtifacts () { + const artifacts = await exec(`sentry-cli releases --org 'metamask' --project 'metamask' files ${VERSION} list`) + // When there's no artifacts, we get a response from the shell like this ['', ''] + return artifacts[0] && artifacts[0].length > 0 +} + async function doesNotFail (asyncFn) { try { await asyncFn() diff --git a/development/verify-locale-strings.js b/development/verify-locale-strings.js index 0eef2b35d..0f408ea39 100644 --- a/development/verify-locale-strings.js +++ b/development/verify-locale-strings.js @@ -20,7 +20,7 @@ const specifiedLocale = process.argv[2] if (specifiedLocale) { console.log(`Verifying selected locale "${specifiedLocale}":\n\n`) const locale = localeIndex.find(localeMeta => localeMeta.code === specifiedLocale) - verifyLocale({ locale }) + verifyLocale(locale) } else { console.log('Verifying all locales:\n\n') localeIndex.forEach(localeMeta => { @@ -30,11 +30,10 @@ if (specifiedLocale) { } -function verifyLocale ({ localeMeta }) { +function verifyLocale (localeMeta) { const localeCode = localeMeta.code const localeName = localeMeta.name let targetLocale, englishLocale - try { const localeFilePath = path.join(process.cwd(), 'app', '_locales', localeCode, 'messages.json') targetLocale = JSON.parse(fs.readFileSync(localeFilePath, 'utf8')) |