Files: bc67c2749ae9d68f54ef3d51c504dd4722172ec7 / 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