Comments (13)
Great work! this would also be nice for the cli
version. Something like nwbuild --run myapp
.
Would you like to add tests for it and send a PR? Trying to get this whole thing shipped by the end of next week.
from nw-builder.
My implementation actually just downloads node-webkit for all versions in the options, instead of the one for your current platform. It could completely fail if for some reason in the uncommon case that your current platform wasn't included.
from nw-builder.
I would just download the current platform. So if you are on a mac just download the mac version and ignore the --platform
settings if it get's called with --run
from nw-builder.
👍
from nw-builder.
The first version is published to npm - should add tests at some point :) Tell me what you think
from nw-builder.
Thanks!
El abr 20, 2014 11:08 AM, "Steffen Müller" [email protected]
escribió:
The first version is published to npm - should add tests at some point :)
Tell me what you think—
Reply to this email directly or view it on GitHubhttps://github.com//issues/2#issuecomment-40895626
.
from nw-builder.
So now it downloads only the current platform, but only in the CLI. I'm using the module directly, so running it would still download the platforms in the options. Ideally, you should be able to do
nwb = new NwBuilder({
files: 'app/**/*',
platforms: ['mac'] // (doesn't contain current platform)
});
nwb.run(); // only dl current platform (only windows for instance)
setTimeout(function(){
nwb.build(); // dl chosen platforms (only mac)
}, require("timespan")("5 years").ms());
Changing options.platforms
only works for a NwBuilder
instance that won't be used again, so it wouldn't work for the above (somewhat ridiculous) case to just move the switch(process.platform){...}
into run
(which would be nice and simple)
Rather downloadNodeWebkit
should be given an argument (platforms)
and be called with options.platforms
when building and the result* of the switch when running.
*I'm used to coffeescript.
from nw-builder.
hmm why are you not using the CLI version for running nw? It wasn't designed to be used programmatically. What exactly are you trying to do? I don't really get it from the code above.
from nw-builder.
hmm why are you not using the CLI version for running nw?
Well it didn't exist when I started using the module and also using a cakefile/gulpfile lets you do more with one command, like compiling coffeescript before building/running the app. And not just with a command, but with a keyboard shortcut (^b) in Sublime Text.
It wasn't designed to be used programmatically.
It should be, as it's a real use case, and a recommended one: "For Gulp, just use the module"?
The CLI should just be an interface to the module, and the module should do the choosing of the downloading of the relevant versions and whatnot.
from nw-builder.
My team definitely will be using this only programmatically
from nw-builder.
I'd like to make a pull request with the small change of moving the platform-choosing out of the CLI and into the API
I think I know enough git to do that now :P
from nw-builder.
Got this working, although I found the use of the files
option when called with run
to be a little weird (especially since it needs to be a glob). Seems like you should be able to just pass in a dir when in run mode and have it create the files object that gets passed to checkFiles
. Won't need to do a replace on options.files
in the runApp
either, just pass in the dir and spawn against that.
Thoughts? I can put together a PR...
from nw-builder.
Put together a PR and let's check it out.
from nw-builder.
Related Issues (20)
- unzipper failed. Emitted 'error' event on DuplexWrapper instance at #289 HOT 8
- nw-builder 4.5.3 requires WINE on Windows 11 HOT 3
- Add documentation on how to use package HOT 1
- Migrate back to `yauzl-promise` for unzipping MacOS binaries HOT 1
- Use Google's Release Please bot to automate releases HOT 1
- nw-builder always redownloads nw.js binaries HOT 2
- PR test coverage requirement HOT 7
- Cant use nwbuild HOT 4
- v0.87.0 MacOS builds don't launch with nw-builder v4.7.4 HOT 7
- Download manifest seems to not be cached, which leads to failures when builds are run in parallel HOT 2
- Cannot run nwbuild command HOT 2
- EN_US is not defined HOT 2
- postinstall script fails because of missing base-volta-off-of-nwjs HOT 3
- End of Central Directory Record not found HOT 7
- linux platform builds with ffmpeg enabled fail with zlib error '[ ERROR ] incorrect header check' HOT 2
- Enabling and disabling `options.ffmpeg` still uses community FFmpeg on successive build HOT 4
- Rename MacOS Helpers HOT 3
- Node Native Addon (gyp, nan, cmake, ffi)
- Canary builds HOT 1
- nw-builder download stuck HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nw-builder.