Created
May 8, 2020 00:57
-
-
Save herrozerro/bf048b0f14445e2c6eb60fe9026ca04b to your computer and use it in GitHub Desktop.
This file contains 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
var Module = { | |
locateFile: function (s) { | |
return './lib/wasm-git/' + s; | |
} | |
}; | |
importScripts('./lib/wasm-git/lg2.js'); | |
Module.onRuntimeInitialized = () => { | |
const lg = Module; | |
FS.mkdir('/working'); | |
FS.mount(MEMFS, {}, '/working'); | |
FS.chdir('/working'); | |
FS.writeFile('/home/web_user/.gitconfig', '[user]\n' + | |
'name = Test User\n' + | |
'email = test@example.com'); | |
// clone a local git repository and make some commits | |
lg.callMain(['clone', `https://github.com/herrozerro/WritingGit.git`, 'testrepo']); | |
FS.readdir('testrepo'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment