Skip to content
Permalink
Browse files

api export: add timestamp and git rev info

  • Loading branch information...
haraldschilly committed Mar 5, 2019
1 parent 896556e commit 0ef9a0625d9e4e89da6a1be64c9ae469256425eb
Showing with 8 additions and 2 deletions.
  1. +8 −2 src/scripts/export-api-doc.ts
@@ -2,11 +2,17 @@
// $ tsc export-api-doc.ts && nodejs export-api-doc.js
// then copy 'api.json' over to the root of cocalc-doc


import { writeFileSync } from "fs";
import { execSync } from "child_process";

const api_root = "/api/v1/";
const api_doc = require("../smc-util/message").documentation;
api_doc.root = api_root;
api_doc.timestamp = new Date().toISOString();
const gitrev = execSync("git rev-parse HEAD");
api_doc.gitrev = gitrev
.toString()
.split("\n")[0]
.trim();

writeFileSync('api.json', JSON.stringify(api_doc, null, 2))
writeFileSync("api.json", JSON.stringify(api_doc, null, 2));

0 comments on commit 0ef9a06

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.