Skip to content

Commit

Permalink
fix: directly write open rpc versions to schema
Browse files Browse the repository at this point in the history
  • Loading branch information
BelfordZ committed Oct 2, 2020
1 parent b18c2c1 commit d3ab70f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
10 changes: 1 addition & 9 deletions bin/build.js → bin/set-openrpc-version-enum.js
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

const schema = require('../schema.json');
const fs = require('fs');
const path = require('path');
const { promisify } = require('util');
const writeFile = promisify(fs.writeFile);
const {listReleases} = require("@etclabscore/dl-github-releases");
Expand All @@ -14,14 +13,7 @@ const setOpenRPCVersionEnum = async (s) => {

const build = async () => {
const withVersionEnum = await setOpenRPCVersionEnum(schema);

const dir = path.resolve(__dirname, "../build/");
try {
fs.mkdirSync(dir);
} catch (e) {

}
await writeFile(`${dir}/schema.json`, JSON.stringify(withVersionEnum, undefined, " "));
await writeFile("schema.json", JSON.stringify(withVersionEnum, undefined, " "));
console.log("wrote schema.json");
};

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"url": "https://github.com/open-rpc/meta-schema.git"
},
"scripts": {
"build": "bin/build.js",
"build": "bin/set-openrpc-version-enum.js",
"test": "jest src/test.ts",
"lint": "eslint . --ext .ts",
"test:watch": "npm run test -- --watch"
Expand Down

0 comments on commit d3ab70f

Please sign in to comment.