Skip to content

Commit 9a6be80

Browse files
committed
correcting error display and TRAVIS_TAG logic
1 parent 9e307d0 commit 9a6be80

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

build/build.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ let webpackConfig = require('./webpack.prod.conf')
1111

1212
console.log('building for production...')
1313

14-
rm('-r', config.build.build_dir)
14+
// remove the entire ./dist directory to avoid confusion
15+
rm('-r', path.resolve(__dirname, '../dist'))
1516

1617
webpack(webpackConfig, function (err, stats) {
1718
if (err) throw err

config.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
var path = require('path')
22

3-
if (process.env['TRAVIS_TAG'] !== undefined) {
4-
console.log('detected TRAVIS_TAG')
3+
if (process.env['TRAVIS_TAG']) {
4+
console.log(`detected TRAVIS_TAG "${process.env['TRAVIS_TAG']}", building for release deploy.`)
5+
if (process.env['TRAVIS_TAG'] !== process.env.npm_package_version) {
6+
throw `travis tag does not match npm_pckage_version: \
7+
${process.env['TRAVIS_TAG']} vs ${process.env.npm_package_version}`
8+
}
59
var prod_build_dir = path.resolve(__dirname, 'dist', process.env.npm_package_version)
610
var prod_public_path = 'https://cdn.tutorcruncher.com/socket/' + process.env.npm_package_version + '/'
711
} else {

src/app.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<template>
22
<div id="tcs-app">
3-
<div v-if="$root.errors" class="tcs-errors">
3+
<div v-if="$root.error" class="tcs-errors">
44
<h2>Error</h2>
55
<p>
66
An error occurred with TutorCruncher socket:
77
</p>
8-
<p class="tcs-error-content">{{ $root.errors }}</p>
8+
<p class="tcs-error-content">{{ $root.error }}</p>
99
<p>
1010
<dl>
1111
<dt>If you're visiting this site:</dt>

0 commit comments

Comments
 (0)