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

(BUG) Task sends a POST request for EACH file being uploaded (not just 1) #18

Open
dbe opened this issue Apr 25, 2018 · 3 comments
Open

Comments

@dbe
Copy link

dbe commented Apr 25, 2018

I was getting inconsistent behavior with the grunt-screeps module where sometimes, some of the files in my dist/ folder were not being uploaded. The behavior was inconsistent however. Sometimes all of my files would be uploaded, sometimes a few would be cut off.

It looks like the issue is that there is a POST request being sent with all of the files, for EACH file found. Essentially it is just an indentation issue where the post request construction and execution should not be inside of the forEach(file) function.

I'm happy to submit a PR for this bug.

@tsssp
Copy link

tsssp commented Aug 4, 2019

I encounted the same bug.

@geoffpotter
Copy link

I'm pretty sure this isn't actually a bug, and your PR will effectively break some features of this tool(although I'm not sure anyone uses these features) I'm working on setting up a new codebase and happened across this post, so decided to test this out while I was poking around in the code.

The foreach function that contains the POST request doesn't run a for each on the FILES, but the.. mappings? if you look, it's doing a filter and then a map on the for each's iteration variable's .src property, which is apparently a list of the actual file paths that have been requested to be uploaded.

I'm guessing this means you could, with some creative settings(google "grunt this.files" for more info on how the files array works) have this plugin upload a combined set of files from two different directories.

Either way, it seems like it's working the way it's supposed to, it's just that grunt is kinda complicated, apparently.

I'm guessing you have something weird going on with your config. do you have multiple deploy targets setup maybe? Can you post your gruntfile so we can see if there's anything going on there?

@steam8x18
Copy link

I also encounter missing file problem. But I noticed that the Gruntfile I copied from is filled with complicated settings in screeps.dist session. This Gruntfile is in the readme file of grunt-screeps repo. I think the problem is cause by screeps.dist.files
settings although I dont realy understand their meanings.
After I change the Gruntfile to the simple one descripbed in https://docs.screeps.com/contributed/advanced_grunt.html , the missing file problem seem to be solved.

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

No branches or pull requests

4 participants