SamKirkland / ftp-deploy

Deploy websites over FTP with one command line
MIT License
89 stars 43 forks source link

Old files are not deleted during deployment if `local-dir` is specified #7

Closed iuwqyir closed 3 years ago

iuwqyir commented 3 years ago

Problem If you specify local-dir, old files are not deleted.

Steps to reproduce

Expected delete.this.txt is deleted and new.txt is uploaded

Actual result new.txt is uploaded, but delete.this.txt is not deleted Log output:

removing delete.this.txt...
> DELE dist/delete.this.txt
< 550 Could not delete dist/delete.this.txt: No such file or directory

Possible solution This happens because there is no dist folder on the remote. The problem is that here the basePath is passed to the removeFile function. However, basePath exists on the local server, not the remote server.

basePath value should be replaced with the value from server-dir setting