evothings / evothings-studio

Evothings Studio
http://www.evothings.com/
Apache License 2.0
53 stars 33 forks source link

New ES6 support means that running ES6 Examples may hit permission issues #164

Closed gokr closed 8 years ago

gokr commented 8 years ago

...but copying them first into MyApps works fine. This is because the Workbench may not have write permission in the examples directory of the installation.

ghost commented 8 years ago

Some possible solutions:

First solution is probably the least confusing from the user's perspective. Would require some special code in the Workbench to handle the case of when the app is run from the "examples" folder.

The code in evothings-examples also need to include built files (the entire www folder?). This is a bit messy.

Compiling the example when building the examples in evothings-examples is another appraoch, but the code for doing the compilation is not that easy to extract from the Workbench. It can be done, but require some work, and Babel needs to be added to evothings-examples.

A first step could be to manually add compiled files to evothings-examples, but not that ideal.

Removing/disabling the Run button is the easiest solution from a technical perspective, I guess.

Any other ideas?

ghost commented 8 years ago

The Workbench could test if it is possible to write to examples, catch the error and disable Run if write is not permitted.

ghost commented 8 years ago

Here is another solution that would be straightforward to implement, and also make sense for the user and be informative:

When the user clicks Run, and the project is to be built (check in evothings.json), do a test to determine if write is permitted, if so, build and run as usual, if not, display a dialog telling the user to copy the project then run it.

gokr commented 8 years ago

Solved in 2.1, examples are run from tmp directories now.