Socket
Socket
Sign inDemoInstall

sftp-upload-plugin

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sftp-upload-plugin - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

.idea/misc.xml

6

index.js

@@ -9,7 +9,7 @@ const upload = require ('./server/upload');

apply(compiler) {
compiler.plugin('done', (compilation, callback) => {
upload(this.config, callback);
compiler.hooks.done.tap('done', () => {
upload(this.config);
});
compiler.plugin('failed', (err) => {
compiler.hooks.failed.tap('failed', (err) => {
console.log(err);

@@ -16,0 +16,0 @@ });

{
"name": "sftp-upload-plugin",
"version": "1.0.3",
"version": "1.0.4",
"description": "upload thought SFTP after build",

@@ -25,4 +25,5 @@ "main": "index.js",

"dependencies": {
"cli-progress": "^3.0.0",
"ssh2-sftp-client": "^2.5.0"
}
}

@@ -5,2 +5,3 @@ const Client = require ('ssh2-sftp-client');

const fs = require ('fs');
const _cliProgress = require('cli-progress');

@@ -71,6 +72,10 @@ /*

const bar = new _cliProgress.SingleBar({}, _cliProgress.Presets.shades_classic);
bar.start(200, 0);
// create files
for (let i = 0; i < fileHandler.length; i++) {
try {
console.log('files uploading --------------- ', parseInt((i + 1)/fileHandler.length * 100), '%');
console.log('files uploading --------------- ', parseInt((i + 1)/fileHandler.length * 100));
bar.update(parseInt((i + 1)/fileHandler.length * 100 * 2));
await this.put(fileHandler[i], fileHandler[i].replace(localPath, remotePath))

@@ -81,2 +86,3 @@ } catch (e) {

}
bar.stop();

@@ -87,3 +93,3 @@ return 'Finish upload'

// 开始上传
function upload (config, cb) {
function upload (config) {
sftp

@@ -93,3 +99,3 @@ .connect (config)

sftp.dirPut(config.localPath, config.remotePath)
.then(() => cb())
.then(() => process.exit(0))
})

@@ -96,0 +102,0 @@ .catch (err => {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc