Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fis-command-release

Package Overview
Dependencies
Maintainers
1
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fis-command-release - npm Package Compare versions

Comparing version 0.8.1 to 0.8.2

46

lib/deploy.js

@@ -8,9 +8,9 @@ /*

function upload(receiver, to, release, file){
function upload(receiver, to, release, content, subpath){
fis.util.upload(
//url, request options, post data, file
receiver, null, { to : to + release }, file,
receiver, null, { to : to + release }, content, subpath,
function(err, res){
if(err || res != '0'){
fis.log.error('upload file [' + file.subpath + '] to [' + to +
fis.log.error('upload file [' + subpath + '] to [' + to +
'] by receiver [' + receiver + '] error [' + (err || res) + ']');

@@ -22,3 +22,3 @@ } else {

time.grey + ' ' +
file.subpath.replace(/^\//, '') +
subpath.replace(/^\//, '') +
' >> '.yellow.bold +

@@ -33,2 +33,29 @@ to + release +

function deliver(output, md5, release, content, file){
if(!release){
fis.log.error('unable to get release path of file['
+ file.realpath
+ ']: Maybe this file is neither in current project or releasable');
}
if(fis.util.exists(output) && !fis.util.isDir(output)){
fis.log.error('unable to deliver file['
+ file.realpath + '] to dir['
+ output + ']: invalid output dir.');
}
var target;
if(md5 == 0 || !file.useHash){
target = fis.util(output, release);
fis.util.write(target, content);
} else if(md5 == 1){
target = fis.util(output, file.getHashRelease(release));
fis.util.write(target, content);
} else {
target = fis.util(output, release);
fis.util.write(target, content);
target = fis.util(output, file.getHashRelease(release));
fis.util.write(target, content);
}
}
function replaceFrom(path, from){

@@ -51,11 +78,16 @@ if(path.indexOf(from) === 0){

var release = replaceFrom(file.release, dest.from);
var content = file.getContent();
var charset = file.charset;
if(file.isText() && content.length && charset !== 'utf8' && charset !== 'utf-8'){
content = fis.util.toEncoding(content, charset);
}
if(dest.receiver){
if(!file.useHash || dest.md5 != 1){
upload(dest.receiver, dest.to, release, file);
upload(dest.receiver, dest.to, release, content, file.subpath);
}
if(file.useHash && dest.md5 > 0){
upload(dest.receiver, dest.to, file.getHashRelease(release), file);
upload(dest.receiver, dest.to, file.getHashRelease(release), content, file.subpath);
}
} else {
file.deliver(dest.to, dest.md5, release);
deliver(dest.to, dest.md5, release, content, file);
}

@@ -62,0 +94,0 @@ } else {

2

package.json
{
"name" : "fis-command-release",
"description" : "fis release command.",
"version" : "0.8.1",
"version" : "0.8.2",
"author" : "FIS Team <fis@baidu.com>",

@@ -6,0 +6,0 @@ "homepage" : "http://fis.baidu.com/",

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