How does vscode delete existing code on the server before uploading code using gulp?

because you don"t want to manually go to xftp and pull the packaged code into the project directory after each package, gulp and gulp-sftp are used to upload the code as follows:

  var gulp = require("gulp")
  var sftp = require("gulp-sftp")
  gulp.tast("default", function () {
    return gulp.src("/dist/**/*")
      .prpe(sftp({
        host: "xxxxx",
        port: 22,
        user: "xxxxx",
        pass: "xxxxx",
        remotePath: "xxxxx"
      }))
  })

upload is no problem, but will not delete the existing code package, I would like to ask, how to delete the existing code? I probably understand that it is operated through the command of ftp, but I don"t have any clue about it. Please advise ~


took a look at the source code. Other operations are not supported, only upload function. You can use gulp-cmd to operate the server through the ssh command, for example:

ssh root@host rm 
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e4f8ae-65658.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e4f8ae-65658.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?