How to use the @cardstack/git/change.prototype function in @cardstack/git

To help you get started, we’ve selected a few @cardstack/git examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cardstack / cardstack / packages / git-hyperledger / patch-change.js View on Github external
const Change = require('@cardstack/git/change');
const Gitchain = require('cardstack-gitchain');
const oldMakeCommit = Change.prototype._makeCommit;
const log = require('@cardstack/logger')('cardstack/git-hyperledger');

Change.prototype._makeCommit = async function(commitOpts) {
  let commit = await oldMakeCommit.call(this, commitOpts);

  let gitchain = new Gitchain(this.repo.path(), null, {logger: log.info.bind(log)});

  try {
    await gitchain.push(commit.sha());
  } catch (e) {
    log.error("Error pushing to hyperledger blockchain");
  }

  return commit;
};
github cardstack / cardstack / packages / git-hyperledger / patch-change.js View on Github external
const Change = require('@cardstack/git/change');
const Gitchain = require('cardstack-gitchain');
const oldMakeCommit = Change.prototype._makeCommit;
const log = require('@cardstack/logger')('cardstack/git-hyperledger');

Change.prototype._makeCommit = async function(commitOpts) {
  let commit = await oldMakeCommit.call(this, commitOpts);

  let gitchain = new Gitchain(this.repo.path(), null, {logger: log.info.bind(log)});

  try {
    await gitchain.push(commit.sha());
  } catch (e) {
    log.error("Error pushing to hyperledger blockchain");
  }

  return commit;
};

@cardstack/git

Git data source plugin for @cardstack/hub.

MIT
Latest version published 5 years ago

Package Health Score

48 / 100
Full package analysis