Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(minor): use shell option for complex commands in onSuccess

Merged
merged 1 commit into from Jun 10, 2022

Conversation

jgoux
Copy link
Contributor

@jgoux jgoux commented Jun 8, 2022

Hello,

I activated the shell option for executing commands passed to onSuccess. It allows for more complicated commands and workflows.

A very concrete use-case is to reboot a web server after the build is done:

{
  "scripts": {
    "dev": "tsup src/index.ts --format esm,cjs --clean --watch src --onSuccess 'pnpm build:types && kill-port 4000 && pnpm start'",
    "build": "tsup src/index.ts --format esm,cjs --clean --onSuccess 'pnpm build:types'",
    "build:types": "tsc --project tsconfig.build.json --emitDeclarationOnly --declaration --declarationMap",
    "start": "node ./dist/index.js",
  }
}

Sorry for the code format changes but it seems like prettier wasn't run on dev?

@vercel
Copy link

vercel bot commented Jun 8, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
tsup Ready (Inspect) Visit Preview Jun 8, 2022 at 9:09AM (UTC)

const args = parts.splice(1)
existingOnSuccess = execa(exec, args, {
existingOnSuccess = execa(options.onSuccess, {
shell: true,
Copy link
Contributor Author

@jgoux jgoux Jun 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the interesting change. 😄

@jgoux jgoux changed the title feat(onSuccess): use shell option for complex commands feat: use shell option for complex commands in onSuccess Jun 8, 2022
@egoist egoist changed the title feat: use shell option for complex commands in onSuccess feat(minor): use shell option for complex commands in onSuccess Jun 10, 2022
@egoist egoist merged commit be48b8b into egoist:dev Jun 10, 2022
6 checks passed
@github-actions
Copy link

github-actions bot commented Jun 10, 2022

🎉 This PR is included in version 6.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants