Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import * as git from 'isomorphic-git';
- import FS from "@isomorphic-git/lightning-fs";
- window.fs = new FS("fs");
- git.plugins.set("fs", window.fs);
- window.pfs = window.fs.promises;
- window.dir = "/dirk"
- pfs.mkdir(dir);
- git.clone({
- fs,
- dir,
- url: "https://cors-anywhere.herokuapp.com/https://gitlab.com/milan.lakhani/crash-system-safety-analysis",
- ref: "master",
- singleBranch: true,
- depth: 10
- });
- pfs.readdir(dir);
- pfs.writeFile(`${dir}/README.md`, "# I am from the React script!", "utf8");
- git.status({dir, filepath: "README.md"});
- git.add({dir, filepath: "README.md"});
- git.status({dir, filepath: "README.md"});
- let sha = git.commit({
- dir,
- message: "test iso git",
- author: {
- name: "Milan Lakhani",
- email: "milan.l@hotmail.co.uk"
- }
- })
- console.log(git.log({dir, depth:1}));
- git.addRemote({dir, remote:"origin2", url:"https://gitlab.com/milan.lakhani/crash-system-safety-analysis"});
- let pushResponse = git.push({
- dir: "/",
- remote: "origin2",
- ref: "master",
- token: "*********", // Not telling you this Jakub!
- url:"https://gitlab.com/milan.lakhani/crash-system-safety-analysis"
- });
- console.log(pushResponse);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement