jakejs / jake

JavaScript build tool, similar to Make or Rake. Built to work with Node.js.
http://jakejs.com
Apache License 2.0
1.97k stars 190 forks source link

PackageTask does not work on windows #258

Open grofit opened 10 years ago

grofit commented 10 years ago

I am one of those mavericks using nodejs on windows and the package task doesn't work as it has no knowledge of 'tar' on the path.

mde commented 10 years ago

What is the actual error message? The PackageTask is really just tasks created using Jake's normal task API: https://github.com/jakejs/jake/blob/master/lib/package_task.js

I will have to scrounge around and find a Windows machine to test this on -- any chance you could narrow this down, or even take a stab at patching it?

grofit commented 10 years ago

Sorry I was not clear in my first message, the error was something along the lines of tar is not an a known executable or path variable, basically windows doesn't have anything installed by default (to my knowledge) to create tars on the command line. So the default tarCommand is tar which fails. I am not sure what the fix would be, as I assume there is no notion of tar creation within base windows, so unless you package a tar/zip packager with the library I am not sure how to fix it... as all the package task seems to do is just build up a command exec string then run it through the command line.

mde commented 10 years ago

It shouldn't be trying to execute tar unless you tell it you want a tar archive with one of the 'needTar*' properties. What you probably want is 'needZip': https://github.com/jakejs/jake/blob/master/lib/package_task.js#L130

If that isn't working correctly, this is definitely a bug.

grofit commented 10 years ago

AH! this is where there needs to be some clarification then. I was requesting it to tar as I needed to package a local module. As npm wanted it in tar.gz format I thought I would use this, I ended up using one of the other tar libs in the end. However I just assuming when using this that under the hood there was some module used to create the files. So if not it may be worth updating the docs to at least mention that in windows you cannot tar via the packageTask... well not without installing your own tar exe on the path, through cygwin or something.

mde commented 10 years ago

Ah, that's a good point. Actually the docs are right in the repo: https://github.com/jakejs/jake/blob/master/docs/overview.md#packagetask Would you be willing to add a Windows-centric example or some cautionary text?

grofit commented 10 years ago

I am happy to add a blurb warning people that tar wont work on windows, but one of the reasons I may this bug was to make sure I was not doing anything wrong, as this may not be a legitimate bug, but I pretty much did exactly the same as the example in the documents, I wish I still had it but I deleted the code as I just needed to get something up and running. The windows example is the same as any other packageTask example its just you get an error at the end if you use tar.

Anyway I will add some cautionary text but feel free to remove it if this is not an issue and just something wrong with mine.