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)
- Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/my-path/nw-app/node_modules/nw-builder/get/decompress.js' HOT 3
- Specify log level
- Glob Issue: cp EINVAL src and dest is same HOT 10
- Bug: building win64 produces undefined.exe. HOT 3
- Bug: osx64 build can't be signed - nwjs bundle format unrecognized HOT 4
- Win64 build icon not showing up HOT 25
- NSIS Installer HOT 1
- AppImage Installer HOT 1
- Compress `outDir` to `zip`, `tar`, `tgz` formats
- [osx64] Unable to set icon - results in blank icon HOT 4
- [osx64] Copyright is not configurable - always set to default nwjs HOT 10
- Windows Store compatible
- Build fails with "package.json not found in srcDir file glob patterns" error HOT 9
- Executable file if run on another machine fails HOT 15
- Improvements to bring in line with nwjs-builder-phoenix HOT 6
- Problem building 0.78.1 + osx + arm64 HOT 5
- libffmpeg not being installed into correct folder HOT 5
- on some macOS, symbolic links are copied as files and link is lost
- Symlinks are copied as files on decompress HOT 9
- `argv` is not properly handled
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.