Skip to content

beforeBuildCommand doesn't run in a shell #1295

@gabcoh

Description

@gabcoh

Describe the bug
The beforeBuildCommand key in src-tauri/tauri.conf.json is not run in a shell. It is split by spaces and then the first word becomes the command and the rest are the arguments. Quoting is not respected and you can not run commands like cd dir && command. As of 164e3a4 beforeDevCommand is run in a shell, but it seems like in dev both beforeBuildCommand and beforeDevCommand are run by splitting on spaces.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new project
  2. set beforeBuildCommand in src-tauri/tauri.conf.json to echo A && echo B
  3. run yarn tauri build
  4. A && echo B is printed
    Expected behavior
    This should be printed
A
B

Screenshots
If applicable, add screenshots to help explain your problem.

Platform and Versions (please complete the following information):

OS: linux
Node: 15.8.0
NPM: 6.14.11
Yarn: 1.22.10
Rustc: 1.50.0

Additional context
Add any other context about the problem here.

Stack Trace

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions