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

sync_when_open

Marcel Kloubert edited this page Jun 11, 2017 · 8 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 exists on the remote side
  • the remote file is newer
  • the local file has NOT been changed while the current editor session (or alwaysSyncIfNewer is set to (true))
  • the target supports downloads

Settings

As object

{
    "deploy": {
        "packages": [
            {
                "name": "My project",
                
                "syncWhenOpen": {
                    "files": [
                        "/**/*.php"
                    ],

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

        "targets": [        
            {
                "name": "My test target",
                "type": "test"
            }
        ]
    }
}
Name Description
exclude Files to exclude (s. node-glob).
files Files to include (s. node-glob). Default: **
target The name of the target from where to sync. If not defined, the targets of the underlying package are used.
useGitIgnoreStylePatterns Also check directory patterns, like in .gitignore files, in that package or not. Default: (true)

As string (target name)

You can define the name of the target, that is used to sync files from.

In that case the patterns of the underlying package are used.

{
    "deploy": {
        "packages": [
            {
                "name": "My project",

                "files": [
                    "/**/*.php"
                ],

                "syncWhenOpen": "My test target"
            }
        ],

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

As boolean value

You can define if the feature is activated for all files of the underlying package or not.

In that case the target list (targets) of the underlying package is used.

{
    "deploy": {
        "packages": [
            {
                "name": "My project",

                "files": [
                    "/**/*.php"
                ],

                "syncWhenOpen": true,

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

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