ueno-llc / react-native-starter

Professional react-native starter kit with everything you'll ever need to deploy rock solid apps
https://ueno-llc.github.io/react-native-starter
MIT License
574 stars 90 forks source link

android build-env.sh call has wrong working directory #211

Closed dgobaud closed 5 years ago

dgobaud commented 5 years ago

the new call to build-env.sh in build.gradle https://github.com/ueno-llc/react-native-starter/pull/210/files#diff-dc46f9f5dfe204e394fb41395ccd03cfR4 seems to work but it has wrong working directory i think

../../scripts/build-env.sh: line 66: ./ios/passfolio/GoogleService-Info.plist: No such file or directory
[SCRIPT build-env.sh] Warning: No GoogleService-Info.plist file in ios app directory... Added placeholder for now!
../../scripts/build-env.sh: line 71: ./android/app/google-services.json: No such file or directory
[SCRIPT build-env.sh] Warning: No google-services.json file in android app directory... Added placeholder for now!
[SCRIPT build-env.sh] Warning: No .env file found... Copied .env.public to .env!
cp: .env.public: No such file or directory
[SCRIPT build-env.sh] Building environment config
[SCRIPT build-env.sh] Using .env
cat: .env: No such file or directory
[SCRIPT build-env.sh] Generating ./src/config.env.js
[SCRIPT build-env.sh] Config built successfully
jeremybarbet commented 5 years ago

The script is called and run, it's most likely an issue where the script has been run from.

Did you do react-native run-android?

Seems like the variable here stayed at false: https://github.com/ueno-llc/react-native-starter/blob/master/scripts/build-env.sh#L11-L13 but should be true if you run it from android folder

dgobaud commented 5 years ago

see https://github.com/ueno-llc/react-native-starter/pull/212

dgobaud commented 5 years ago

Oh I see I added the exec{...} to my own fork which didn't have the new build-env.sh changes so I think the way you have done it works but for me i need to do what I did in the PR

dgobaud commented 5 years ago

but I do think leaving build-env.sh the way it was and setting the workingDir in the build.gradle is a better solution

jeremybarbet commented 5 years ago

I'll look at it when I have a bit of time 👍

jeremybarbet commented 5 years ago

You are right, it's better like this, thanks for the help, I didn't know about that https://github.com/ueno-llc/react-native-starter/commit/b01e8d62ac75c2e748dda709191415ca837e6039