crabatool 1.0.303 → 1.0.307

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/utils.js CHANGED
@@ -497,10 +497,16 @@ class Utils {
497
497
  }
498
498
 
499
499
  copyFile(filePath, destPath, cb) {
500
- if (filePath == destPath) return;
500
+ if (filePath == destPath) {
501
+ return;
502
+ }
501
503
 
502
504
  utils.mkdirsSync(destPath);
503
505
 
506
+ if (!fs.existsSync(filePath)) {
507
+ return;
508
+ }
509
+
504
510
  var content = fs.readFileSync(filePath);
505
511
  if (cb) {
506
512
  var result = cb(destPath, content); // 显示进度或者自定义替换文本内容
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "crabatool",
3
- "version": "1.0.303",
3
+ "version": "1.0.307",
4
4
  "description": "crabatool",
5
5
  "main": "index.js",
6
6
  "bin": {
package/tool/compress.js CHANGED
@@ -96,7 +96,16 @@ function doCompress() {
96
96
  // skins
97
97
  var skinPath = path.join(config.targetPath, 'src/Carpa.Web/skins');
98
98
  utils.copyFiles(path.join(skinPath, 'ui'), path.join(_tempSkinPath, 'ui'));
99
- //utils.copyFiles(path.join(skinPath, 'font'), path.join(_tempSkinPath, 'font'));
99
+
100
+ var eotPath = path.join(skinPath, 'iconfont.eot');
101
+ if (fs.existsSync(eotPath)) { // 5.5开始新平台打包
102
+ utils.copyFile(eotPath, path.join(_tempSkinPath, 'iconfont.eot'));
103
+ utils.copyFile(path.join(skinPath, 'iconfont.svg'), path.join(_tempSkinPath, 'iconfont.svg'));
104
+ utils.copyFile(path.join(skinPath, 'iconfont.ttf'), path.join(_tempSkinPath, 'iconfont.ttf'));
105
+ utils.copyFile(path.join(skinPath, 'iconfont.woff'), path.join(_tempSkinPath, 'iconfont.woff'));
106
+ } else {
107
+ utils.copyFiles(path.join(skinPath, 'font'), path.join(_tempSkinPath, 'font')); // 兼容老的平台打包,5.4
108
+ }
100
109
 
101
110
  // craba.min.css
102
111
  inNames = ['iconfont.css', 'craba.min.css'];