wilr / grunt-shopify

Grunt plug-in for publishing Shopify theme assets
BSD 3-Clause "New" or "Revised" License
107 stars 32 forks source link

grunt watch:shopify not publishing despite successful status report #53

Closed ghost closed 7 years ago

ghost commented 9 years ago

Running on:

Windows v8.1 grunt-cli v0.1.13 grunt v0.4.5 grunt-shopify v0.6.0

Shopify:

    options: {
        api_key: "------------------------------------",
        password: "------------------------------------",
        url: "------------------------------------",
        theme: "------------",
        base: "themes/main/"
    }

Watch:

    shopify: {
        files: [
            theme + "assets/**",
            theme + "layout/**",
            theme + "snippets/**",
            theme + "templates/**"
        ],
        tasks: ["shopify"]
    }

Theme:

grunt.option('theme', path.join(process.cwd(), 'themes/main/'));

Run:

When running grunt watch:shopify and changing a file:

$ grunt watch:shopify
Running "watch:shopify" (watch) task
Waiting...
>> File "themes\main\templates\cart.liquid" changed.
Running "shopify" task

Done, without errors.
Completed in 1.594s at Tue Jul 07 2015 14:47:39 GMT+0100 (GMT Summer Time) - Waiting...

The changed file however, has not been pushed to the Shopify server.

ctalkington commented 9 years ago

im noticing this though i'm a bit more specific in my watch config and don't change the base anymore.

shopify: {
  files: [
    'assets/*.*',
    'config/*.*',
    'layout/*.*',
    'locales/*.*',
    'snippets/*.*',
    'templates/{,customers/}*.*'
  ],
  tasks: [
    'shopify'
  ]
}
ctalkington commented 9 years ago

in my initial tests, it would appear the watch event is never caught.

running node 0.12.6, grunt 0.4.5, contrib-watch 0.6.1, shopify 0.6.0 on windows. tried shopify 0.5.4 too with same results.

ctalkington commented 9 years ago

ok so not sure how i missed this before but it was the just-in-time task loader in my case.

make sure you have grunt.loadNpmTasks('grunt-shopify'); loaded as early as possible to catch these events.

bradhaas1 commented 8 years ago

Does this plugin even attempt to push? grunt.loadNpmTasks('grunt-shopify'); loads first, i receive the "Done without out errors message." But nothing is ever updated.

Grunt file watch is setup correctly, I see file changed notification messages every time I save on my local, but updates are never made to my remote files.

I even disabled my laptops wireless and I still get "Done without errors. Completed on..."

???

    module.exports = function(grunt) {

        grunt.loadNpmTasks('grunt-shopify');
        grunt.loadNpmTasks('grunt-contrib-watch') 

        grunt.initConfig({
        shopify: {
            options: {
            //You can find these in your Shopify Admin under Apps then look at the bottom for Create a private API Key
                api_key: "XXXXXXXXXXXXXXXXXXXXXXXXXXX",
                password: "XXXXXXXXXXXXXXXXXXXXXXXXXXX",
                url: "STORE-NAME.myshopify.com",
                base: 'shop/'
            }
        },
        watch: {
            shopify: {
                files: ['shop/**'],
                tasks: ["shopify"],
                theme: ["Shopify-Birthday-Suit-Master"]
            }
        }
        });
        grunt.registerTask('default', ['shopify', 'watch']);
    };
MelchnerRoman commented 8 years ago

@bradhaas1

"theme" must be in task "shopify" shopify: { options: { api_key: "xxxxx", password: "xxxxxx", url: "name.myshopify.com", theme: '1234567', //number of theme (get it with grunt shopify:themes) } }, and then watch task: watch: { shopify: { files: ["assets/**", "layout/**", "snippets/**", "templates/**"], tasks: ["shopify"], options: { spawn: false, }, } },

wilr commented 7 years ago

Closing as it sounds like resolved. If not, try 1.0.0 and let me know if you need clarification.