![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
gulp-vsftppro
Advanced tools
该插件是基于gulp-vsftp
修改的,增加了备份和上传七牛cdn的功能
npm install gulp-vsftppro --save-dev
const vsftpPro = require('gulp-vsftppro')
将 dist/static 文件夹下的所有资源上传到七牛
gulp.task('uploadQn', function () {
return gulp.src('./dist/static/**').pipe(vsftpPro.qn(
{
accessKey: '*******',
secretKey: '*******',
bucket: '*******', // 空间名
origin: 'http://*******.clouddn.com', //外链默认域名
prefix: `/${new Date().getTime()}/` // 添加文件前缀
}))
})
将 dist/ 下的文件上传到服务器,除 dist/index.html 外
gulp.task('uploadDist', function () {
return gulp.src('./dist/**').pipe(vsftpPro.server({
remotePath: '*******', //上传远程服务器的文件路径
host: '*******', // 服务器 ip
user: '*******',
pass: '*******',
cleanFiles: false, // 是否清空 remotePath 下的资源文件
uploadIndexHtml: false, // 是否上传 remotePath 下的 index.html,默认 true
port: 22
}))
})
将 dist/index.html 文件上传到服务器
gulp.task('uploadHtml', function () {
return gulp.src('./dist/index.html').pipe(vsftpPro.server({
remotePath: '*******', //上传远程服务器的文件路径
host: '*******', // 服务器 ip
user: '*******',
pass: '*******',
cleanFiles: false, // 是否清空 remotePath 下的资源文件
backupIndexHtml: true, // 是否备份 remotePath 下的 index.html
port: 22
}))
})
将 remotePath 根目录下backupIndexHtml文件夹下的 index.html copy 到 remotePath
gulp.task('index-rollBack', function () {
let scp = vsftpPro.scp
scp.initScp({
remotePath: '*******', //上传远程服务器的文件路径
host: '*******', // 服务器 ip
user: '*******',
pass: '*******',
port: 22
}).then(() => {
scp.copyFile('/backupIndexHtml/index.html', '/index.html')
})
})
先将资源文件上传到七牛或其他CDN,再将 .html 文件上传到服务器
gulp.task('upload', gulpSequence('uploadQn', 'uploadHtml'))
或 先将资源文件上传到服务器,接着再传 .html 文件
gulp.task('upload', gulpSequence('uploadDist', 'uploadHtml'))
最后欢迎 star
或提 issues
或 PR
,一起来完善插件👏👏👏
FAQs
Upload files via SSH
The npm package gulp-vsftppro receives a total of 9 weekly downloads. As such, gulp-vsftppro popularity was classified as not popular.
We found that gulp-vsftppro demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.