Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
j-f1 committed Jul 4, 2018
1 parent 7d1dee5 commit 0cabb14
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
13 changes: 5 additions & 8 deletions script/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,13 @@ if (PUBLISH_CHANNELS.indexOf(distInfo.getReleaseChannel()) < 0) {
}

const releaseSHA = distInfo.getReleaseSHA()
if (!releaseSHA) {
if (releaseSHA == null) {
console.log(`No release SHA found for build. Skipping publish.`)
process.exit(0)
}

const currentTipSHA = gitInfo.getSHA()
if (
!currentTipSHA ||
!currentTipSHA.toUpperCase().startsWith(releaseSHA!.toUpperCase())
) {
if (!currentTipSHA.toUpperCase().startsWith(releaseSHA!.toUpperCase())) {
console.log(
`Current tip '${currentTipSHA}' does not match release SHA '${releaseSHA}'. Skipping publish.`
)
Expand All @@ -34,7 +31,7 @@ import * as request from 'request'
console.log('Packaging…')
execSync('yarn package')

const getSha = () => {
function getSha() {
if (process.platform === 'darwin' && process.env.CIRCLE_SHA1 != null) {
return process.env.CIRCLE_SHA1
} else if (
Expand All @@ -51,7 +48,7 @@ const getSha = () => {

const sha = getSha().substr(0, 8)

const getSecret = () => {
function getSecret() {
if (process.env.DEPLOYMENT_SECRET != null) {
return process.env.DEPLOYMENT_SECRET
}
Expand Down Expand Up @@ -151,7 +148,7 @@ function upload(assetName: string, assetPath: string) {
s3.upload(
uploadParams,
(error: Error, data: AWS.S3.ManagedUpload.SendData) => {
if (error) {
if (error != null) {
reject(error)
} else {
// eslint-disable-next-line no-sync
Expand Down
2 changes: 1 addition & 1 deletion script/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function getPortOrDefault() {

function startApp() {
const runningApp = run({ stdio: 'inherit' })
if (!runningApp) {
if (runningApp == null) {
console.error(
"Couldn't launch the app. You probably need to build it first. Run `yarn build:dev`."
)
Expand Down
3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
"include": [
"app/**/*.ts",
"app/**/*.tsx",
"app/**/*.d.tsx",
"app/webpack.*.ts"
"app/**/*.d.tsx"
],
"exclude": [
"node_modules",
Expand Down

0 comments on commit 0cabb14

Please sign in to comment.