Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After purge with purge-before[] files/dirs do not loaded into this directory #371

Open
Glashkoff opened this issue Sep 16, 2019 · 3 comments

Comments

@Glashkoff
Copy link

Hi. I'm not understanding setting purge-before [].
My repo contains:

/dir1
/dir1/file_in_dir_1
/dir2
/dir2/file_in_dir_2
file1
file2

phploy.ini:

[production]
    scheme = 'sftp'
    user = '#'
    pass = '#'
    host = #
    path = /var/www/#/htdocs/
    port = #
    branch = master
    permissions = 0700
    directoryPerm = 0775
    exclude[] = '*.bak'
    exclude[] = '*.log'
    exclude[] = '.vscode'
    purge-before[] = "dir2/"

I do phploy --fresh and see in log:

SERVER: production
Purging directory dir2/
....

And in the dir2 directory there were files only from the repo, everything is OK.
Next, I run phploy and dir2 is cleared up. That is the same as if I used purge []
Is this normal behavior?

@Glashkoff
Copy link
Author

After three weeks of use, I came to the conclusion that purge-before[] works just like purge[].

@Liingon
Copy link
Contributor

Liingon commented Oct 21, 2019

Hi! purge-before works just like purge, the only difference is that purge-before runs before any uploads and purge runs after uploads. I use it to clear a directory (that is not tracked by git) before uploading new files to it. In my case it's js and css files generated by webpack that have unique names so the old files don't get overwritten and needs to be removed. I hope this helps clear it up!

@Glashkoff
Copy link
Author

Glashkoff commented Oct 21, 2019

@Liingon thanks for the answer. Does this mean that uploads should not happen at all for such directories?
Unfortunately, in my case, after purge-before, the directory remains empty, although there are files in the repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants