ftp-cmd-upload
v1.0.3
Published
Build files and upload to ftp server
Downloads
8
Maintainers
Readme
ftp-cmd-upload
Build files and upload to ftp server
###1.create ftp.config in root
ftp.config
the file is in soucefiles,jsonn5 config. Config the file, it will remove the remotePath
first,and make sure the MLSD
is disenable
the remotePath must start with /
{
uploadconfig: {
uploadPath: './dist/', /** the local path to upload **/
ftpConnectConfig: {
user: 'test',
host: '127.0.0.1',
port: 21,
password: '131415926',
},
remotePath: '/testdist', /** the ftp server path to upload, must start with / **/
ignoreList: ['upload','update'] /**this folders will not be removed **/
}
}
###2.create *.js to start(you can use node *.js
) upload
const tools = require('ftp-cmd-upload');
Start();
async function Start(){
await tools.cmdTool.Run('npm run build'); // run the build action
await tools.ftpTool.UploadFiles(); //start to upload
}