SamKirkland / ftp-deploy

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

Fixed the 550 Errors that sometimes happen when deploying #14

Closed Penguibird closed 2 years ago

Penguibird commented 3 years ago

Added some try catch blocks and other measures to catch out 550 errors like in these issues: https://github.com/SamKirkland/FTP-Deploy-Action/issues/220 https://github.com/SamKirkland/FTP-Deploy-Action/issues/218 https://github.com/SamKirkland/FTP-Deploy-Action/issues/214

When using the action for my website I'd get build fails because the action would try to remove a non existent file, or add a file to a directory that didn't exist etc.

It has been linted and tested and I also used it to upload my website and it worked as desired.

SamKirkland commented 2 years ago

Hello @Penguibird,

I appreciate the PR but I'm not comfortable merging this into the solution.

A exception should be thrown when a program reaches a state where it produce unintended results. I believe this bug is caused by the script being in the incorrect folder when excluding commands. If we did not throw an exception the program would continue deploying the code to the wrong folders.

The root bug needs to be fixed in order to accept this PR. In this bugs case we need to figure out why the script is in the wrong folder.

I will be closing this PR, however if you wish to update the code or create a new PR looking into the root cause I will be happy to assist any way I can.

Thanks again, Have a great day - Sam Kirkland

SamKirkland commented 2 years ago

After looking at this more the root cause of this bug is due to calling this.client.removeDir( with the full folder path instead of the relative folder path (calling with the absolute folder path would also work)