Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

sync_when_open

Marcel Kloubert edited this page Jul 9, 2018 · 10 revisions

Home >> Packages >> Sync when open

Sync when open

This feature synchronizes files from a remote target when opening in the editor automatically.

Demo Sync when open

This happens:

  • when the file can be downloaded from remote
  • the remote file is newer
  • the local file has NOT been changed while the current editor session
{
    "deploy.reloaded": {
        "packages": [
            {
                "name": "My project",
                
                "syncWhenOpen": true,

                "files": [
                    "**/*.css",
                    "**/*.js"
                ],

                "targets": [ "My test target" ]
            }
        ],

        "targets": [        
            {
                "name": "My test target",
                "type": "test"
            }
        ]
    }
}

Possible values

As boolean value

The following example syncs any file of the package, by using its target list (My test target).

{
    "deploy.reloaded": {
        "packages": [
            {
                "name": "My project",
                
                "syncWhenOpen": true,

                "files": [
                    "**/*.css",
                    "**/*.js"
                ],

                "targets": [ "My test target" ]
            }
        ],

        "targets": [        
            {
                "name": "My test target",
                "type": "test"
            }
        ]
    }
}

As string / target

Syncs any file of the package, by using a custom target (My local FTP server).

{
    "deploy.reloaded": {
        "packages": [
            {
                "name": "My project",
                
                "syncWhenOpen": "My local FTP server",

                "files": [
                    "**/*.css",
                    "**/*.js"
                ]
            }
        ],

        "targets": [        
            {
                "name": "My local FTP server",
                "type": "ftp"
            }
        ]
    }
}

As object / file filter

Syncs the files of the package, by using minimatch sub filters (**/*.min.css and **/*.min.js), from My ZIP target.

{
    "deploy.reloaded": {
        "packages": [
            {
                "name": "My project",
                
                "syncWhenOpen": {
                    "files": [
                        "**/*.min.css",
                        "**/*.min.js"
                    ]
                },

                "files": [
                    "**/*.css",
                    "**/*.js"
                ],

                "targets": [ "My ZIP target" ]
            }
        ],

        "targets": [        
            {
                "name": "My ZIP target",
                "type": "zip"
            }        
        ]
    }
}
Clone this wiki locally