Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit f3d9332

Browse files
committed
refactor: only check if mainAppExists if required
1 parent 00c6880 commit f3d9332

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

bin/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/create-app-environment.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,7 @@ const createHasuraApp = async (
100100
createAppIfNotExists,
101101
} = target
102102

103-
const mainAppExists = await heroku.doesAppExist({ appName: mainAppName })
104103
const hasuraAppExists = await heroku.doesAppExist({ appName: hasuraAppName })
105-
106104
if (!hasuraAppExists) {
107105
if (!createAppIfNotExists) {
108106
throw new Error(
@@ -120,6 +118,7 @@ const createHasuraApp = async (
120118
let jwtSecret: string
121119
let databaseUrl: string
122120

121+
const mainAppExists = await heroku.doesAppExist({ appName: mainAppName })
123122
if (mainAppExists) {
124123
jwtSecret = await heroku.getEnvVar({
125124
appName: mainAppName,

0 commit comments

Comments
 (0)