@pnpm/git-fetcher
Advanced tools
Comparing version 0.1.0 to 0.2.0
@@ -1,10 +0,7 @@ | ||
/** | ||
* clone a git repository. | ||
*/ | ||
export default function (resolution: { | ||
repo: string; | ||
commit: string; | ||
}, dest: string): Promise<{ | ||
headers: any; | ||
integrityPromise: Promise<any>; | ||
}>; | ||
declare const _default: () => { | ||
git: (resolution: { | ||
repo: string; | ||
commit: string; | ||
}, dest: string) => Promise<any>; | ||
}; | ||
export default _default; |
@@ -15,19 +15,15 @@ "use strict"; | ||
const rimraf = require("rimraf-then"); | ||
/** | ||
* clone a git repository. | ||
*/ | ||
function default_1(resolution, dest) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
yield execGit(['clone', resolution.repo, dest]); | ||
yield execGit(['checkout', resolution.commit], { cwd: dest }); | ||
// removing /.git to make directory integrity calculation faster | ||
yield rimraf(path.join(dest, '.git')); | ||
const dirIntegrity = yield dint.from(dest); | ||
return { | ||
headers: dirIntegrity, | ||
integrityPromise: Promise.resolve(dirIntegrity), | ||
}; | ||
}); | ||
} | ||
exports.default = default_1; | ||
exports.default = () => { | ||
return { | ||
git: function fetchFromGit(resolution, dest) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
yield execGit(['clone', resolution.repo, dest]); | ||
yield execGit(['checkout', resolution.commit], { cwd: dest }); | ||
// removing /.git to make directory integrity calculation faster | ||
yield rimraf(path.join(dest, '.git')); | ||
return dint.from(dest); | ||
}); | ||
}, | ||
}; | ||
}; | ||
function prefixGitArgs() { | ||
@@ -34,0 +30,0 @@ return process.platform === 'win32' ? ['-c', 'core.longpaths=true'] : []; |
{ | ||
"name": "@pnpm/git-fetcher", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "A fetcher for git-hosted packages", | ||
@@ -35,3 +35,3 @@ "main": "lib/index.js", | ||
"@types/node": "^8.0.53", | ||
"dint": "^1.0.0", | ||
"dint": "^2.0.0", | ||
"execa": "^0.8.0", | ||
@@ -38,0 +38,0 @@ "rimraf-then": "^1.0.1" |
Sorry, the diff of this file is not supported yet
5173
41
+ Addeddint@2.0.2(transitive)
+ Addedmz@2.7.0(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedp-limit@1.3.0(transitive)
+ Addedp-try@1.0.0(transitive)
+ Addedssri@5.3.0(transitive)
+ Addedthenify@3.3.1(transitive)
+ Addedthenify-all@1.6.0(transitive)
- Removedbluebird@3.7.2(transitive)
- Removeddint@1.0.0(transitive)
- Removedssri@4.1.6(transitive)
Updateddint@^2.0.0