mikenorthorp / gulp-shopify-upload

gulp plugin to watch and upload files to Shopify for use in theme editing
Other
40 stars 21 forks source link

Enables setting base path, for added flexibility (fix for #1) #6

Closed AP-Hunt closed 9 years ago

AP-Hunt commented 9 years ago

Hi Mike,

Please consider this PR, in which I re-enable the ability to change the base theme directory when uploading files. According to #1 the ability was removed, but I believe the added flexibility in the plugin will be a boon to users; certainly, I found I needed that ability, as did @NemoAlex (who raised the issue).

In the PR, I have added an additional, optional argument to the plugin. Now, one can call it from gulp as such:

var options = {
    "basePath": "some/other-dir/"
};

// With a theme id
gulpShopify('API KEY', 'PASSWORD', 'MYSITE.myshopify.com', 'THEME ID', options)

// Without a theme id
gulpShopify('API KEY', 'PASSWORD', 'MYSITE.myshopify.com',  null, options)

As it stands, the only option available is basePath, but by adding a simple options hash the plugin gains an easy way to add more flexibility in the future.

I will shortly add documentation updates to this PR.

Regards, Andy Hunt