Advertisement
Guest User

React iso git cors anywhere

a guest
Feb 10th, 2020
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React, { Component } from "react";
  2. import ReactDOM from "react-dom";
  3. import * as git from 'isomorphic-git';
  4. import FS from "@isomorphic-git/lightning-fs";
  5.  
  6. class TableContainer extends Component {
  7.  
  8.   ...... methods which culminate in a table ......
  9.  
  10.   componentDidMount() {
  11.     window.fs = new FS("fs");
  12.     git.plugins.set("fs", window.fs);
  13.     window.pfs = window.fs.promises;
  14.     window.dir = "/dirk";
  15.     console.log(dir);
  16.  
  17.     pfs.mkdir(dir);
  18.  
  19.     git.clone({
  20.       fs,
  21.       dir,
  22.       url: "https://cors-anywhere.herokuapp.com/https://gitlab.com/celduin/crash/crash-system-safety-analysis",
  23.       ref: "master",
  24.       singleBranch: true,
  25.       depth: 10
  26.     });
  27.     pfs.readdir(dir);
  28.     console.log(git.log({dir}));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement