Skip to content

Commit 2df9e1b

Browse files
authored
remix-init: use sindresorhus/open to open links after deploy (#348)
1 parent 008f756 commit 2df9e1b

File tree

3 files changed

+394
-7
lines changed

3 files changed

+394
-7
lines changed

remix.init/index.mjs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import crypto from 'crypto'
44
import { $, execa } from 'execa'
55
import fs from 'fs/promises'
66
import inquirer from 'inquirer'
7+
import open from 'open';
78
import path from 'path'
89
import toml from '@iarna/toml'
910

@@ -197,13 +198,11 @@ async function setupDeployment({ rootDirectory }) {
197198
)
198199
console.log(` Starting with staging`)
199200
await $I`fly deploy --app ${APP_NAME}-staging`
200-
// "fly open" was having trouble with opening the staging app
201-
// so we'll just use "open" instead.
202-
await $I`open https://${APP_NAME}-staging.fly.dev/`
201+
await open(`https://${APP_NAME}-staging.fly.dev/`)
203202

204203
console.log(` Staging deployed... Deploying production...`)
205204
await $I`fly deploy --app ${APP_NAME}`
206-
await $I`open https://${APP_NAME}.fly.dev/`
205+
await open(`https://${APP_NAME}.fly.dev/`)
207206
console.log(` Production deployed...`)
208207
console.log(' Moving Dockerfile and .dockerignore back to other/')
209208
await fs.rename(
@@ -231,7 +230,7 @@ async function setupDeployment({ rootDirectory }) {
231230
console.log(
232231
`Opening repo.new. Please create a new repo and paste the URL below.`,
233232
)
234-
await $I`open https://repo.new`
233+
await open(`https://repo.new`)
235234

236235
const { repoURL } = await inquirer.prompt([
237236
{
@@ -250,8 +249,8 @@ async function setupDeployment({ rootDirectory }) {
250249
console.log(
251250
`Opening Fly Tokens Dashboard and GitHub Action Secrets pages. Please create a new token on Fly and set it as the value for a new secret called FLY_API_TOKEN on GitHub.`,
252251
)
253-
await $I`open https://web.fly.io/user/personal_access_tokens/new`
254-
await $I`open ${repoURL}/settings/secrets/actions/new`
252+
await open(`https://web.fly.io/user/personal_access_tokens/new`)
253+
await open(`${repoURL}/settings/secrets/actions/new`)
255254

256255
console.log(
257256
`Once you're finished with setting the token, you should be good to add the remote, commit, and push!`,

0 commit comments

Comments
 (0)