From dbfc858e1942b900a9fb33ca39b049770c2c4844 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Sat, 24 Nov 2012 13:56:46 +0800 Subject: [PATCH] rm helper -r --- helper/README.md | 27 ----------------------- helper/tools/get-static.js | 45 -------------------------------------- 2 files changed, 72 deletions(-) delete mode 100644 helper/README.md delete mode 100644 helper/tools/get-static.js diff --git a/helper/README.md b/helper/README.md deleted file mode 100644 index 5482435..0000000 --- a/helper/README.md +++ /dev/null @@ -1,27 +0,0 @@ -B3log Solo 皮肤工具 -================================================== - -PSD ------------------------------------------- -存放皮肤中用到的 psd 文件 - -skin-preview ------------------------------------------- -存放每个皮肤的预览图片。命名规则为: skinName[-pathname].png - -tools ------------------------------------------- -皮肤辅助工具(Node.js) -* compress.js - 对 js, css 进行压缩后在当前目生成 XXX.min.js/css 文件 -* get-static.js - 提取皮肤中的 js, css, image 等静态资源到 b3log-solo-skins/helper/tools/static 目录下 -* update-version.js - 批量更新 skin.properties 文件中的 forSolo 版本号 - ------------------------------------------- -平等,自由,奔放 - -Equality, Freedom, Passion - -;-) diff --git a/helper/tools/get-static.js b/helper/tools/get-static.js deleted file mode 100644 index 5efb842..0000000 --- a/helper/tools/get-static.js +++ /dev/null @@ -1,45 +0,0 @@ -var fs = require('fs'), -path = require('path'); - -var getAllFiles = function (root){ - var res = [], - files = fs.readdirSync(root); - - files.forEach(function(file){ - var pathname = root+'/'+file, - stat = fs.lstatSync(pathname); - - if (!stat.isDirectory()){ - if (file.indexOf(".ftl") < 0 && file.indexOf(".properties") < 0 - && root.indexOf("../../helper") < 0 && root.indexOf("../../.git") < 0) { - res.push(pathname); - } - } else { - res = res.concat(getAllFiles(pathname)); - } - }); - return res; -}; - -var mkdirsSync = function(dirpath) { - if(fs.existsSync(dirpath)){ - return; - } - var dirs = dirpath.split('/'); - var dir = ''; - for(var i = 0; i < dirs.length; i++) { - dir += dirs[i] + '/'; - if(!fs.existsSync(dir)){ - fs.mkdirSync(dir); - } - } -}; - -var skins = getAllFiles("../.."); -(function () { - mkdirsSync("static"); - for (var i = 0; i < skins.length; i++) { - mkdirsSync(path.dirname(skins[i].replace("../..", "static/skins"))); - fs.writeFileSync(skins[i].replace("../..", "static/skins"), fs.readFileSync(skins[i]), "UTF-8"); - } -})(); \ No newline at end of file