Files: 21960d62467278cd5659e2eb5f80cc6ddd87e663 / tools / injectTypes
456 bytesRaw
1 | #!/usr/bin/env node |
2 | const fs = require('fs') |
3 | const types = require('../customTypes') |
4 | |
5 | const typeinfoFile = process.argv[2] |
6 | const inputWasmFile = process.argv[3] |
7 | const outputWasmFile = process.argv[4] |
8 | |
9 | const typeinfo = JSON.parse(fs.readFileSync(typeinfoFile)) |
10 | const inputWasm = fs.readFileSync(inputWasmFile) |
11 | |
12 | const buf = types.encodeJSON(typeinfo) |
13 | const outputWasm = types.injectCustomSection(buf, inputWasm) |
14 | |
15 | fs.writeFileSync(outputWasmFile, outputWasm) |
16 |
Built with git-ssb-web