All-Hands-AI / OpenHands

🙌 OpenHands: Code Less, Make More
https://all-hands.dev
MIT License
33.37k stars 3.82k forks source link

Update `npm` scripts for cross-platform compatibility with PowerShell and Unix shells #4466

Open amanape opened 2 weeks ago

amanape commented 2 weeks ago

Our current npm scripts for development (dev and dev:mock) are written in a way that works on Unix-like shells but may not work on Windows PowerShell due to differences in how environment variables are set.

The issue arises from setting environment variables inline (e.g., VITE_MOCK_API=false), which isn't compatible with PowerShell.

SUGGESTED FIX: Use the cross-env package to ensure that environment variables are set in a way that's compatible across all platforms.

"scripts": {
  "dev": "npm run make-i18n && cross-env VITE_MOCK_API=false remix vite:dev",
  "dev:mock": "npm run make-i18n && cross-env VITE_MOCK_API=true remix vite:dev"
}

Originally posted by @danicruz0415 in https://github.com/All-Hands-AI/OpenHands/issues/4397#issuecomment-2421181635

github-actions[bot] commented 2 weeks ago

OpenHands started fixing the issue! You can monitor the progress here.

github-actions[bot] commented 2 weeks ago

A potential fix has been generated and a draft PR #4467 has been created. Please review the changes.

sikehish commented 1 week ago

Is this still open? If not, I'd like to take this up

mamoodi commented 1 week ago

@amanape how does the OpenHands PR look? Are you going to work off of that or should sikehish take a look at this issue?

amanape commented 1 week ago

@sikehish Feel free to do so! You can look into #4467 as reference. It already solves the issue but introduces some other problems