Skip to content

Commit

Permalink
add skip env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
kentcdodds committed Sep 22, 2023
1 parent 50bf03c commit fc96c59
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 11 deletions.
19 changes: 19 additions & 0 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,25 @@ Check the project README.md for instructions on getting the app deployed. You'll
want to get this done early in the process to make sure you're all set up
properly.

If you'd like to skip some of the setup steps, you can set the following
environment variables when you run the script:

- `SKIP_SETUP` - skips running `npm run setup`
- `SKIP_FORMAT` - skips running `npm run format`
- `SKIP_DEPLOYMENT` - skips deployment setup

So, if you enabled all of these it would be:

```sh
SKIP_SETUP=true SKIP_FORMAT=true SKIP_DEPLOYMENT npx create-remix@latest --install --init-script --git-init --template epicweb-dev/epic-stack
```

Or, on windows:

```
set SKIP_SETUP=true && set SKIP_FORMAT=true && set SKIP_DEPLOYMENT=true && npx create-remix@latest --install --init-script --git-init --template epicweb-dev/epic-stack
```

## Development

- Initial setup:
Expand Down
28 changes: 17 additions & 11 deletions remix.init/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -76,20 +76,26 @@ export default async function main({ rootDirectory }) {

await Promise.all(fileOperationPromises)

execSync('npm run setup', { cwd: rootDirectory, stdio: 'inherit' })
if (!process.env.SKIP_SETUP) {
execSync('npm run setup', { cwd: rootDirectory, stdio: 'inherit' })
}

execSync('npm run format -- --log-level warn', {
cwd: rootDirectory,
stdio: 'inherit',
})
if (!process.env.SKIP_FORMAT) {
execSync('npm run format -- --log-level warn', {
cwd: rootDirectory,
stdio: 'inherit',
})
}

await setupDeployment({ rootDirectory }).catch(error => {
console.error(error)
if (!process.env.SKIP_DEPLOYMENT) {
await setupDeployment({ rootDirectory }).catch(error => {
console.error(error)

console.error(
`Looks like something went wrong setting up deployment. Sorry about that. Check the docs for instructions on how to get deployment setup yourself (https://github.com/epicweb-dev/epic-stack/blob/main/docs/deployment.md).`,
)
})
console.error(
`Looks like something went wrong setting up deployment. Sorry about that. Check the docs for instructions on how to get deployment setup yourself (https://github.com/epicweb-dev/epic-stack/blob/main/docs/deployment.md).`,
)
})
}

console.log(
`
Expand Down

0 comments on commit fc96c59

Please sign in to comment.