Skip to content

fix(cli.rs): prefix the "before script" env vars with TAURI_#3274

Merged
lucasfernog merged 3 commits intonextfrom
JonasKruckenberg-patch-1
Jan 24, 2022
Merged

fix(cli.rs): prefix the "before script" env vars with TAURI_#3274
lucasfernog merged 3 commits intonextfrom
JonasKruckenberg-patch-1

Conversation

@JonasKruckenberg
Copy link
Member

Before we exported env vars to the "before scripts" (beforeDevCommand and beforeBuildCommand) like this ARCH, PLATFORM and VERSION which is problematic for two reasons:

  1. It can clash with env variables defined by the OS (ARCH is very generic for example)
  2. It wasn't clear that the env vars above came from the tauri bundling process.
  3. Tools like vite, have a whitelist by prefix for security reasons. So having everything prefixed with TAURI_ will make life easier and more secure for our tauri+vite users.

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Docs
  • New Binding issue #___
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change?

  • Yes, and the changes were approved in issue #___
  • No

Checklist

  • When resolving issues, they are referenced in the PR's title (e.g fix #___, #___)
  • A change file is added if any packages will require a version bump due to this PR per the instructions in the readme.
  • I have added a convincing reason for adding this feature, if necessary

Other information

@JonasKruckenberg JonasKruckenberg requested a review from a team as a code owner January 24, 2022 08:56
@JonasKruckenberg JonasKruckenberg requested a review from a team January 24, 2022 08:56
Copy link
Member

@FabianLars FabianLars left a comment

Choose a reason for hiding this comment

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

Good idea imo

@JonasKruckenberg
Copy link
Member Author

JonasKruckenberg commented Jan 24, 2022

Good idea imo

I caused the problem, I fix the problem lol 😂

@lucasfernog lucasfernog merged commit 9bb6897 into next Jan 24, 2022
@lucasfernog lucasfernog deleted the JonasKruckenberg-patch-1 branch January 24, 2022 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants