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

Windows compatibility issue #123

Open
mischakolbe opened this issue Jun 11, 2023 · 3 comments
Open

Windows compatibility issue #123

mischakolbe opened this issue Jun 11, 2023 · 3 comments
Labels
backend bug Something isn't working medium-prio question Further information is requested

Comments

@mischakolbe
Copy link
Contributor

Are these fancier start/build/test scripts in the package.json required?

...
  "scripts": {
    "start": "REACT_APP_COMMIT_HASH=$(git rev-parse HEAD) react-scripts start",
    "build": "REACT_APP_COMMIT_HASH=$(git rev-parse HEAD) react-scripts build",
    "test": "REACT_APP_COMMIT_HASH=$(git rev-parse HEAD) react-scripts test",
    ...

I got errors on Windows (terminal, bash & powershell) and a hacky equivalent probably doesn't work on Mac...

...
  "scripts": {
    "start": "git rev-parse HEAD >sha.txt && set /p REACT_APP_COMMIT_HASH= < sha.txt && del sha.txt && react-scripts start",
    "build": "git rev-parse HEAD >sha.txt && set /p REACT_APP_COMMIT_HASH= < sha.txt && del sha.txt && react-scripts build",
    "test": "git rev-parse HEAD >sha.txt && set /p REACT_APP_COMMIT_HASH= < sha.txt && del sha.txt && react-scripts test",
    ...

I don't think the commit hash is very necessary and we could just switch to this?

...
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    ...
@mischakolbe mischakolbe added bug Something isn't working question Further information is requested backend medium-prio labels Jun 11, 2023
@mAkeddar
Copy link
Contributor

Yep the original file for scripts is this one
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
}

The app launch doesn't depend on the hash, right @hugo2410 ?

@hugo2410
Copy link
Collaborator

@mAkeddar @mischakolbe having the git hash before building allows us to have for every single build. So, we are sure that even if we get the versioning wrong (as it is done manually) we are able to trace back to the specific version of the code. It would allow us to debug easier. I can try and investigate how we need to adapt the path to make it work cross-platform

@mischakolbe
Copy link
Contributor Author

mischakolbe commented Jun 12, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend bug Something isn't working medium-prio question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants