New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

grunt-cacheinfo

Package Overview
Dependencies
Maintainers
2
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-cacheinfo - npm Package Compare versions

Comparing version 0.1.9 to 0.1.10

2

package.json
{
"name": "grunt-cacheinfo",
"description": "cacheinfo.",
"version": "0.1.9",
"version": "0.1.10",
"homepage": "http://gitlab.alibaba-inc.com/trip-tools/grunt-cacheinfo",

@@ -6,0 +6,0 @@ "author": {

@@ -19,2 +19,4 @@ # grunt-cacheinfo

- 0.1.10
- 优化读取项目配置文件
- 0.1.6

@@ -21,0 +23,0 @@ - 如果预发config.json没有配置包路径的时候,取当前abc.json里的配置

@@ -15,2 +15,3 @@ /*

var url = require('url');
var util = require('util');
var clamUtil = require('clam-util');

@@ -52,2 +53,3 @@ var exec = require('child_process').exec;

var pwd = process.cwd();
var config_url = options.configUrl || 'http://g.alicdn.com/trip/offline-config/index.json';

@@ -123,3 +125,3 @@ getGlobalConfig(function(globalConfig){

function getPkgConfig(globalConfig){
var abc = require(path.resolve(process.cwd(), options.abc));
var abc = require(path.resolve(process.cwd(), options.abc));
var pkg = {},

@@ -134,9 +136,32 @@ isPkgFound = false;

}
return isPkgFound ? pkg : {
name: abc.name,
version:abc.version,
type: 'h5',
main: abc.basePath,
wapUrl:'http://h5.m.taobao.com' + abc.baseUrl
};
if(isPkgFound) {
grunt.log.info('从 ' + config_url + ' 中读取到 ' + abc.name + ' 的配置信息');
return pkg;
} else {
// 校验 abc.json 是否缺少必须字段
var errorTpl = 'abc.json 中缺少 "%s" 字段或为空,请补全后重试!',
requiredKeys = ['version', 'basePath', 'baseUrl'],
errorParam = '';
requiredKeys.forEach(function (key) {
if(!abc[key]) {
errorParam = key;
return;
}
});
if(errorParam) {
grunt.fail.warn(util.format(errorTpl, errorParam));
return null;
} else {
return {
name: abc.name,
version:abc.version,
type: 'h5',
main: abc.basePath,
wapUrl:'http://h5.m.taobao.com' + abc.baseUrl
};
}
}
}

@@ -146,3 +171,2 @@

function getGlobalConfig(ok){
var config_url = options.configUrl || 'http://g.alicdn.com/trip/offline-config/index.json';
http.get(config_url,function(res){

@@ -149,0 +173,0 @@ var raw = '';

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