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

Support renaming generated files #30

Closed
joneshf opened this issue Jul 10, 2014 · 23 comments
Closed

Support renaming generated files #30

joneshf opened this issue Jul 10, 2014 · 23 comments
Labels
feature Priority: 2

Comments

@joneshf
Copy link

joneshf commented Jul 10, 2014

Thanks for this program! It has made working with node-webkit a bit easier.

I'd like to suggest that the generated files take on the application's name. In particular: nw on linux, node-webkit.app on osx and nw.exe on windows. If you're for it, I'll submit a PR, but It's a bit awkward to have this generate the specified names without knowing that's what's going to happen. From the README, it seems that the name supplied (or the one in the package.json) would be the name of the application when it was generated. You could still default it to the original names if not supplied anything. I've not found anything that states this isn't possible, and from testing, renaming seems to work on all os's.

Is there any reason why this isn't/can't be supported? If not, expect a PR soon.

@gabepaez
Copy link
Contributor

Great idea. We can make this happen.

@RobinMalfait
Copy link

@joneshf in grunt-node-webkit-builder it renames it and also adds the right images.

Maybe you can look at that project to inspire your code ;)

👍

@gabepaez
Copy link
Contributor

Thanks. I would like to get node-webkit-builder functioning as the base for grunt-node-webkit-builder as originally intended. I'm just getting started on this so I'll get it done as soon as possible.

@joneshf
Copy link
Author

joneshf commented Jul 31, 2014

@RobinMalfait thanks, I didn't know about the images either. I'm just renaming it with fs or something from gulp.

@gabepaez oh, I had meant this to be a question, more than a request :) But I appreciate you taking it on. I'm more than willing to do the work, just didn't know if it was something this program could/should do. Looking forward to it!

@RobinMalfait
Copy link

@joneshf it would be nice if it reads your package.json file to get the appName and stuff also macIcons and winIco :)

@gabepaez gabepaez reopened this Jul 31, 2014
@gabepaez
Copy link
Contributor

Sorry, I didn't intend on closing this out. I'll look into it now.

@gabepaez
Copy link
Contributor

gabepaez commented Aug 1, 2014

I've got renaming the generated files working on the develop branch 3878c68 but I have only tested on mac. Could either of you verify on other platforms?

@adam-lynch
Copy link
Contributor

@gabepaez What's the status of this?

@gabepaez
Copy link
Contributor

Hi @adam-lynch. This is integrated into the 0.1.2 release. I was able to test successfully on Mac and Windows.

@adam-lynch
Copy link
Contributor

@gabepaez thanks. Is there any potential issues because the app isn't named nw.exe? See nwjs/nw.js#199. Only asking cause I know @4ver ran into some problem there

@gabepaez
Copy link
Contributor

@adam-lynch you are absolutely right. Any ideas?

@gabepaez gabepaez reopened this Aug 20, 2014
@4ver
Copy link

4ver commented Aug 20, 2014

@adam-lynch @gabepaez If you do allow renaming the executable add a note to the readme. Apps will run fine so long as they don't require any native modules.

@joneshf
Copy link
Author

joneshf commented Aug 21, 2014

I've been building this way since the npm release and not run into issues so far. Building for linux, osx and win on linux.

@4ver what are native modules?

@4ver
Copy link

4ver commented Aug 21, 2014

It's a module that includes code written in c++ which is compiled using node-gyp or nw-gyp. As far as I can remember- the issue only occurs on windows. node-sqlite3 is an example of such a module.

@adam-lynch
Copy link
Contributor

@4ver so in our case, we use node-afk, so we can't use this feature? 😦

@tphalp
Copy link

tphalp commented Sep 26, 2014

@adam-lynch According to that repo, it's 100% javascript, so you should be okay.

@4ver
Copy link

4ver commented Sep 26, 2014

@tphalp At the time @adam-lynch commented it did contain a native portion but I have since switched to a windows binary (see: Teamwork/node-afk@a266e46) to avoid having to compile versions for different architectures/nw versions.

@adam-lynch
Copy link
Contributor

So yeah, not naming the Windows exectuable as nw.exe can cause problems.

We've three options;

  • The appName option allow multiple names (one per platform). Not sure how it would be though, in this case you'd want them all to be exampleApp except Windows. So maybe instead....
  • There could be an extra option (e.g. containsNativeModules) which when set to true names the Windows executable nw.exe. This would be ignored if you're not building for Windows.
  • Or do nothing and leave it up to the user. This sounds reasonable except the exectuable is a few directories deep after node-webkit-builder is ran.

cc @gabepaez

@gabepaez
Copy link
Contributor

@adam-lynch I think your second idea is the best short term solution. Allowing the user to specify different names on each platform just adds complication to the API to address a bug that only affects a smaller segment of users. Also, doing nothing seems wrong given that the module would be generating broken apps without a built in solution.

@joneshf
Copy link
Author

joneshf commented Oct 16, 2014

Is the long term solution to fix node webkit so that it doesn't require the executable to be named some arbitrary name?

@gabepaez
Copy link
Contributor

That seems reasonable enough...

@joneshf
Copy link
Author

joneshf commented Jun 16, 2015

I've been out of the loop for a while. Is this still relevant or can the issue be closed?

@adam-lynch
Copy link
Contributor

@joneshf

Is the long term solution to fix node webkit so that it doesn't require the executable to be named some arbitrary name?

Yes and I saw in an NW.js issue recently that they'd like to sort it for NW.js 0.13.0.

Not sure what the status of this issue is though tbh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Priority: 2
Projects
None yet
Development

No branches or pull requests

6 participants