Package Exports
- @git-lazy/util
- @git-lazy/util/spawn/git
- @git-lazy/util/spawn/util
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@git-lazy/util) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@git-lazy/util
@git-lazy core lib and a better cross spawn for gitnpm install @git-lazy/utilimport { crossSpawnSync, crossSpawnAsync, SpawnOptions, checkGitOutput } from '@git-lazy/util/spawn/git';
import { notEmptyString, debug } from '@git-lazy/util';
import { crossSpawnOutput, filterCrossSpawnArgv } from '@git-lazy/util/spawn/util';
export function localBranchList(REPO_PATH: string): string[]
{
let cp = crossSpawnSync('git', [
'branch',
'--list',
'--format=%(refname)',
], {
cwd: REPO_PATH,
});
cp = checkGitOutput(cp);
if (!cp.error)
{
let out = crossSpawnOutput(cp.stdout, {
clearEol: true,
stripAnsi: true,
});
let ls = out.split(/\n/).map(function (s)
{
return s.trim();
});
if (ls.length)
{
return ls
}
}
debug.enabled && debug(crossSpawnOutput(cp.output));
return [];
}