I'm trying to create shallow clone using simple-git. I'm trying to create an equivalent of this command: git clone --depth 1 https://github.com/steveukx/git-js.git. My code is as follows:
const git = require('simple-git')()
const repoURL = 'https://github.com/steveukx/git-js.git';
const localPath= './git-js';
const options = ['--depth', '1'];
const handlerFn = () => {
console.log('DONE')
};
git.clone(repoURL, localPath, options, handlerFn());
I've specified --depth 1 in options, but the code copies the entire repo history, it seems to completely ignore the options given. Am I doing this correctly, what can cause this behaviour?