Andrew Chalkley 9 éve
szülő
commit
010fae3943
4 módosított fájl, 98 hozzáadás és 0 törlés
  1. 15 0
      manifestly/index.js
  2. 31 0
      manifestly/manifest.js
  3. 51 0
      manifestly/manifest.json
  4. 1 0
      package.json

+ 15 - 0
manifestly/index.js

@@ -0,0 +1,15 @@
+"use strict";
+
+const fs = require("fs");
+const fetch = require("node-fetch");
+const ManifestPreparer = require("./manifest").ManifestPreparer;
+
+fs.readFile("./manifest.json", function(err, data){
+    if(err) throw err;
+    let manifest = Object.assign({}, JSON.parse(data), {fetch});
+
+    let preparer = new ManifestPreparer(manifest);
+
+    preparer.prepare();
+});
+

+ 31 - 0
manifestly/manifest.js

@@ -0,0 +1,31 @@
+"use strict";
+
+class ManifestPreparer {
+    constructor(options) {
+        this.recipes = options.recipes;
+        this.download = options.download;
+    }
+
+    prepare() {
+        console.dir(this.recipes);
+    }
+
+    unzip(source, files) {
+
+    }
+
+    untar(source, files) {
+
+    }
+
+    flash() {
+
+    }
+
+    updateAddresses(){
+
+    }
+}
+
+
+module.exports = {ManifestPreparer};

+ 51 - 0
manifestly/manifest.json

@@ -0,0 +1,51 @@
+{
+  "name": "Espruino 1v85",
+  "board": "ESP8266 ESP-12",
+  "description": "Official Binaries for the Espruino Runtime for the ESP8266 MCU ESP-12",
+  "download": "http://www.espruino.com/files/espruino_1v85.zip",
+  "recipes": [
+    {
+      "unzip": {
+        "source": "espruino_1v85.zip",
+        "files": ["espruino_1v85_esp8266.tgz"]
+      }
+    },
+    {
+      "untar": {
+        "source" :"espruino_1v85_esp8266.tgz",
+        "files": [
+          "boot_v1.4(b1).bin",
+          "espruino_esp8266_user1.bin",
+          "esp_init_data_default.bin",
+          "blank.bin"
+        ]
+      }
+    },
+    {
+      "flash": {
+        "baud": 115200,
+        "frequency": "80m",
+        "mode": "qio",
+        "size": "32m",
+        "files": [
+        {
+          "address": "0x0000",
+          "binary": "boot_v1.4(b1).bin"
+        },
+        {
+          "address": "0x1000",
+          "binary": "espruino_esp8266_user1.bin"
+        },
+        {
+          "address": "0x3FC000",
+          "binary": "esp_init_data_default.bin"
+        },
+        {
+          "address": "0x3FE000",
+          "binary": "blank.bin"
+        }
+        ]
+      }
+    }
+  ]
+}

+ 1 - 0
package.json

@@ -24,6 +24,7 @@
   },
   "homepage": "https://github.com/thingsSDK/especially-flasher#readme",
   "dependencies": {
+    "node-fetch": "^1.4.0",
     "serialport": "^2.0.6"
   },
   "devDependencies": {