-
Notifications
You must be signed in to change notification settings - Fork 1
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
Fixing error on npm run ios-sim & npm run android-sim #1
base: master
Are you sure you want to change the base?
Conversation
@evanshortiss FYI |
@@ -11,8 +11,8 @@ | |||
"compile": "tsc && npm run bundle-js && npm run vendor-js", | |||
"bundle-js": "browserify -e src/index.js -o www/bundle.js --no-bundle-external --debug", | |||
"vendor-js": "browserify -o www/vendor.js -r fh-js-sdk -r fastclick -r react-dom -r react", | |||
"ios-sim": "npm run compile && cordova platform add ios ; && cordova run ios --emulator", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
D'oh, my bad! One thing to note is that the ;
was deliberate, I just forgot to remove the &&
on the ios-sim
line.
The reason for this is that if the platform is already added Cordova returns an error exit code on add
. The ;
bypasses this since we just wanted to ensure the platform existed. Check this output:
> ts-react-hello-world@0.1.0 vendor-js workspaces/ts-react-hello-world
> browserify -o www/vendor.js -r fh-js-sdk -r fastclick -r react-dom -r react
Error: Platform ios already added.
Building project: workspaces/ts-react-hello-world/platforms/ios/RHMAP Hello World using TypeScript and React.xcworkspace
Configuration: Debug
Platform: emulator
If we use &&
after the cordova platform add ios
it works fine initially, but any future calls will fail with Error: Platform ios already added.
. The ;
bypasses this.
What are your thoughts on a potnetial alternative for improving this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"ios-sim": "npm run compile && cordova platform add ios ; && cordova run ios --emulator", | ||
"android-sim": "npm run compile && cordova platform add android ; cordova run android --emulator" | ||
"ios-sim": "npm run compile && cordova platform add ios && cordova run ios --emulator", | ||
"android-sim": "npm run compile && cordova platform add android cordova run android --emulator" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we'd need either ;
or &&
here?
Fixing a small error when running the iOS/Android simulator via
npm run ios-sim
.Previous error: