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 fixes #12

Merged
merged 9 commits into from
Jan 14, 2017
Merged

Windows fixes #12

merged 9 commits into from
Jan 14, 2017

Conversation

staff0rd
Copy link
Contributor

@staff0rd staff0rd commented Jan 13, 2017

This ends up with the app running on windows by including the nodobjc dependency only when building on mac, and explicitly excluding the contacts & define plugins. The apps plugin is implicitly excluded due to the try/catch on plugins (windows will throw on the path '/Applications').

The explicit exclusions are a bit hacky - the plugins should probably instead define which platform they run on in config and load only those specific to the currently detected platform.

getFileIcon is setup such that other platform's implementations could be added at a later date.

Tested on both mac & windows. (Mac retains full functionality).

Copy link
Collaborator

@KELiON KELiON left a comment

Choose a reason for hiding this comment

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

I'm going to add these changes in your PR, if you don't mind

@@ -0,0 +1,2 @@
const getFileIcon = process.platform === 'darwin' ? require('./mac') : null
Copy link
Collaborator

Choose a reason for hiding this comment

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

It would be better to export empty function, instead of null to avoid ... is not a function errors

// Core plugins
export { default as apps } from './apps'
export { default as autocomplete } from './autocomplete'
export { default as contacts } from './contacts'
export let contacts
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd just rewrite this block to module.exports instead of static export. It will allow exporting some plugins conditionally, instead of exporting undefined and add conditions above.

@KELiON
Copy link
Collaborator

KELiON commented Jan 13, 2017

@staff0rd can you please review my commit and check that it still works on windows? Let me know and I'll merge this PR.

Thanks for contribution!

@staff0rd
Copy link
Contributor Author

Your changes look good - note that I am absent of any electron or react experience, and my ES6 is based mostly on Typescript, so I am only guessing at conventions in this code.

I'll test this tomorrow, been on the beers tonight :)

@KELiON KELiON mentioned this pull request Jan 13, 2017
@staff0rd
Copy link
Contributor Author

I tested feature/move-osx-plugins on a windows machine - works great.

@KELiON
Copy link
Collaborator

KELiON commented Jan 14, 2017

@staff0rd awesome, thanks for your time!

@KELiON KELiON merged commit bc4dbb1 into cerebroapp:master Jan 14, 2017
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.

None yet

2 participants