Comparing version 1.0.10 to 1.0.11
{ | ||
"name": "tpm", | ||
"version": "1.0.10", | ||
"version": "1.0.11", | ||
"description": "Static Package Manager", | ||
@@ -5,0 +5,0 @@ "author": "Longhao Luo <lhluo@tudou.com>", |
@@ -60,4 +60,6 @@ | ||
pathList.forEach(function(path) { | ||
var cmd = (process.platform === 'win32' ? 'set' : 'export') + ' LANG=en_US && svn info "' + path.replace(/\\/g, '\\\\') + '"'; | ||
var cmd = 'svn info "' + path.replace(/\\/g, '\\\\') + '" --xml'; | ||
console.log(cmd); | ||
var cp = ChildProcess.exec(cmd); | ||
@@ -68,3 +70,3 @@ | ||
var match; | ||
if ((match = /^Last Changed Rev:\s*(\d+)$/im.exec(data))) { | ||
if ((match = /<commit\s+revision="(\d+)">/i.exec(data))) { | ||
var value = match[1]; | ||
@@ -124,8 +126,2 @@ } | ||
var version = data[path]; | ||
var buildPath = addVersion(getBuildPath(path), version); | ||
var distPath = addVersion(getDistPath(path), version); | ||
Util.copyFile(path, buildPath); | ||
Util.copyFile(path, distPath); | ||
return prefix + addVersion(url, version) + suffix; | ||
@@ -136,2 +132,25 @@ } | ||
}); | ||
_.each(data, function(version, path) { | ||
var buildPath = addVersion(getBuildPath(path), version); | ||
var distPath = addVersion(getDistPath(path), version); | ||
if (!Fs.existsSync(buildPath) || Util.mtime(path) >= Util.mtime(buildPath)) { | ||
Util.copyFile(path, buildPath); | ||
} | ||
if (!Fs.existsSync(distPath) || Util.mtime(path) >= Util.mtime(distPath)) { | ||
Util.copyFile(path, distPath); | ||
// 在Windows下优化PNG | ||
if (process.platform === 'win32') { | ||
var cmd = '"' + Path.resolve(__dirname + '/../bin/PngOptimizerCL').replace(/\\/g, '\\\\') + '" -file:"' + distPath.replace(/\\/g, '\\\\') + '"'; | ||
console.log(cmd); | ||
var cp = ChildProcess.exec(cmd); | ||
} | ||
} | ||
}); | ||
callback(content); | ||
@@ -138,0 +157,0 @@ }); |
@@ -28,3 +28,3 @@ | ||
paths.forEach(function(path) { | ||
var cmd = (process.platform === 'win32' ? 'set' : 'export') + ' LANG=en_US && svn info "' + path.replace(/\\/g, '\\\\') + '"'; | ||
var cmd = 'svn info "' + path.replace(/\\/g, '\\\\') + '" --xml'; | ||
@@ -37,6 +37,6 @@ var cp = ChildProcess.exec(cmd); | ||
var line = ''; | ||
if ((match = /^URL:\s*(.+)$/im.exec(data))) { | ||
if ((match = /<url>(.+?)<\/url>/i.exec(data))) { | ||
line += match[1]; | ||
} | ||
if ((match = /^Last Changed Rev:\s*(\d+)$/im.exec(data))) { | ||
if ((match = /<commit\s+revision="(\d+)">/i.exec(data))) { | ||
line += ' ' + match[1]; | ||
@@ -43,0 +43,0 @@ } |
var Path = require('path'); | ||
var Fs = require('fs'); | ||
var util = require('util'); | ||
var Iconv = require('iconv-lite'); | ||
@@ -107,2 +108,7 @@ var UglifyJs = require('uglify-js'); | ||
function mtime(filePath) { | ||
var stat = Fs.statSync(filePath); | ||
return stat.mtime.getTime(); | ||
} | ||
function copyFile(fromPath, toPath) { | ||
@@ -297,2 +303,3 @@ console.log('Copy file: ' + fromPath); | ||
exports.writeFileSync = writeFileSync; | ||
exports.mtime = mtime; | ||
exports.copyFile = copyFile; | ||
@@ -299,0 +306,0 @@ exports.minJs = minJs; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1652100
73
38154
24