فهرست منبع

修改打包设置

zhuzhuyule 8 سال پیش
والد
کامیت
4e700d73b9
8فایلهای تغییر یافته به همراه16 افزوده شده و 29 حذف شده
  1. 0 21
      README.md
  2. BIN
      icons/HexoEditor.icns
  3. BIN
      icons/HexoEditor.ico
  4. BIN
      icons/HexoEditor.png
  5. 2 3
      icons/HexoEditor.svg
  6. 10 5
      package.json
  7. 2 0
      views/main/unit/load_dir.js
  8. 2 0
      views/main/unit/loadconfig.js

+ 0 - 21
README.md

@@ -1,4 +1,3 @@
-
 # HexoEditor
 This is markdown editor for Hexo.
 
@@ -94,23 +93,3 @@ The `Raleway` font is licensed under the OFL open font license.
 
 # Credits
 The domain `moeditor.org` is sponsored by [Showfom](https://ttt.tt/).
-
-
-```
-Support Tag
-- {% cq - %}
-[HexoEditor](https://github.com/zhuzhuyule/HexoEditor)
-{% endcq %}
-
-- {% blockquote zhuzhuyule https://github.com/zhuzhuyule/HexoEditor HexoEditor %}
-This is markdown editor for Hexo.
-{% endblockquote %}
-
-- {% quotelist Reference %}
-Moeditorhttps://github.com/Moeditor/Moeditor
-{% endquotelist %}
- 
-- {% exturl HexoEditor url "title" %}
-- {% btn https://github.com/zhuzhuyule/HexoEditor, HexoEditor, , HexoEditor Button %}
-- {% lb,HexoEditor %}
-```

BIN
icons/HexoEditor.icns


BIN
icons/HexoEditor.ico


BIN
icons/HexoEditor.png


+ 2 - 3
icons/HexoEditor.svg

@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!-- Generator: Adobe Illustrator 17.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
-<svg version="1.1" id="main" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
-	 width="512px" height="512px" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve">
-<path fill="#dcdcdc" d="M256.4 25.8L56.4 141.3L56 371.5L255.6 486.2L455.6 370.7L456 140.5L256.4 25.8ZM160 360L160 160L180.3333 149.3333L200 160L255 310L310 160L330.3333 149.3333L350 160L350 360.5L336 370.3333L320 360L320 210L270.3333 341L255 351L240 340.6667L190 210L190 360.5L175 370.6667L160 360Z" xmlns="http://www.w3.org/2000/svg" />
+<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" version="1">
+	<path xmlns="http://www.w3.org/2000/svg" fill="#dcdcdc" d="M256 26L56 141v231l200 114 200-115V141L256 26zm-96 334V160l20-11 20 11 55 150 55-150 20-11 20 11v201l-14 9-16-10V210l-50 131-15 10-15-10-50-131v151l-15 10-15-11z"/>
 </svg>

+ 10 - 5
package.json

@@ -12,7 +12,7 @@
   "build": {
     "appId": "com.zhuzhuyule.hexoeditor",
     "productName": "HexoEditor",
-    "asar": false,
+    "asar": true,
     "nsis": {
       "artifactName": "${productName}-x64.${ext}",
       "runAfterFinish": false,
@@ -27,13 +27,18 @@
     "publish": {
       "provider": "github"
     },
+    "linux": {
+      "target": [
+        "appImage",
+        "deb"
+      ] ,
+      "icon": "icons/HexoEditor.ico"
+    },
     "win": {
       "target": [
         {
           "target": "nsis",
-          "arch": [
-            "x64"
-          ]
+          "arch": ["x64","ia32" ]
         }
       ],
       "icon": "icons/HexoEditor.ico"
@@ -48,7 +53,7 @@
     "editor",
     "hexomarkdown"
   ],
-  "author": "Menci,zhuzhuxia",
+  "author": "Menci,zhuzhuxia  <zhuzhuyule@126.com> (http://zhuzhuyule.com/)",
   "license": "GPL-3.0",
   "bugs": {
     "url": "https://github.com/zhuzhuyule/HexoEditor/issues"

+ 2 - 0
views/main/unit/load_dir.js

@@ -12,7 +12,9 @@ var load = function(path, name) {
 
 module.exports = function (dir) {
     try{
+        if (!dir) return ;
         dir = dir.toString().replace(/\\+/g, '\\\\');
+	if (!fs.existsSync(dir)) return;
         fs.readdirSync(dir).forEach(function (filename) {
             if (!/\.js$/.test(filename)) {
                 return;

+ 2 - 0
views/main/unit/loadconfig.js

@@ -7,12 +7,14 @@ var defConfig = require('./default_config');
 function loadYAMLFile(file) {
     if (!file) return loadsh.extend({}, defConfig);
     file = file.toString().replace(/\\+/g, '\\\\');
+    if (!fs.existsSync(file)) return {};
     var configPath = file;
     if (fs.statSync(file).isDirectory()) {
         configPath = (path.join(file, '_config.yml'));
     }
     var baseDir = path.dirname(configPath);
     var config = fs.existsSync(configPath) ? YAML.parse(fs.readFileSync(configPath).toString()) : {};
+    defConfig.__basedir = baseDir;
     var themeConfig = {};
     if (config.theme) {
         defConfig.__themedir = path.join( baseDir,'themes',config.theme);