git ssb

0+

wanderer🌟 / js-primea-hypervisor



Tree: a9f71fab3ac71562f46196e5ac263789e5c3f5b5

Files: a9f71fab3ac71562f46196e5ac263789e5c3f5b5 / tools / injectTypes

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

Built with git-ssb-web