Closed ctalkington closed 10 years ago
this should resolve #15 and #35 (for the time being). this needs testing with manually calling upload and delete.
in regards to the manual tasks, i think the biggest constraint is that they will need to be within the base
root which i think was already required.
some examples:
// works from cwd with base 'shop'
grunt shopify:upload:shop/assets/style.css.liquid
// doesn't work from 'shop' with base 'shop'
grunt shopify:upload:assets/style.css.liquid
going to make a few more tweaks to this.
new commit switches to path.resolve as fs.realpathSync does stat and such on file which is overkill for what we are trying to do. i also added warnings (though annoying when the watch picks up files it shouldn't but atleast it's not making API calls now..).
i can switch the warnings to use the notify method but i question if it would create flood of notifications during certain watch instances that pick up invalid files.
ok made some changes to make the watch handler check if filepath is in its base before performing any actions that should resolve my caution of using notify so i've made it all use notify. let me know what you think.
Doesn't break my install so will ship it. Cannot get the duplicate messages when changing files now. One thing I did patch was any errors (say incorrect file path) can through as [Object] so converted those to something readable in 5e52fe05bce3263bd1ee8e6404e47fb56cbadfa5
yah, i had questioned the detail/errors being an array and if it would get converted or not. hadn't tested the logging bit was just making use of the err.detail over resp.errors in my last PR.
i do think the whitelisting and other tweaks will handle quite a few issues.
btw sorry for the flood of PRs. things should quiet down for a bit now :)
can we get a version bump by chance? I think minor is fine being its mostly internal changes.
this should allow only paths in our base/cwd and allowed by shopify to be uploaded.