Problem
If you specify local-dir, old files are not deleted.
Steps to reproduce
Create a dist folder and put some files there (e.g. delete.this.txt)
Set local-dir: dist/
Run deploy. The file is uploaded correctly to the remote server
Change the file's name. (e.g delete.this.txt -> new.txt)
Run deploy again
Expecteddelete.this.txt is deleted and new.txt is uploaded
Actual resultnew.txt is uploaded, but delete.this.txtis 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
Problem If you specify
local-dir
, old files are not deleted.Steps to reproduce
dist
folder and put some files there (e.g.delete.this.txt
)local-dir: dist/
deploy
. The file is uploaded correctly to the remote serverdelete.this.txt
->new.txt
)deploy
againExpected
delete.this.txt
is deleted andnew.txt
is uploadedActual result
new.txt
is uploaded, butdelete.this.txt
is not deleted Log output:Possible solution This happens because there is no
dist
folder on the remote. The problem is that here thebasePath
is passed to theremoveFile
function. However,basePath
exists on the local server, not the remote server.basePath
value should be replaced with the value fromserver-dir
setting