Created
November 11, 2019 18:56
-
-
Save martin12333/6b18a45cdf2910ccbcf37d1b238fdf3b to your computer and use it in GitHub Desktop.
BrowserFS / isomorphic-git test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://unpkg.com/browserfs"></script> | |
<script src="https://unpkg.com/isomorphic-git"></script> | |
<script> | |
async function main () { | |
} | |
BrowserFS.configure({ fs: "IndexedDB", options: {} }, function (err) { | |
if (err) return console.log(err); | |
window.fs = BrowserFS.BFSRequire("fs"); | |
git.plugins.set('fs', window.fs); | |
git.clone({ | |
dir: '.', | |
corsProxy: 'https://cors.isomorphic-git.org', | |
url: 'https://github.com/isomorphic-git/isomorphic-git', | |
singleBranch: true, | |
depth: 1 | |
}) | |
fs.readdir('.', (err, res) => res.map( | |
entry => fs.readdir(`./${entry}`, (err, res) => console.log(entry, res, err ? 'not a dir' : '')) | |
)) | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment