@pnpm/git-fetcher
Advanced tools
Comparing version 0.2.0 to 0.3.1
@@ -5,4 +5,7 @@ declare const _default: () => { | ||
commit: string; | ||
}, dest: string) => Promise<any>; | ||
}, targetFolder: string) => Promise<{ | ||
filesIndex: any; | ||
tempLocation: string; | ||
}>; | ||
}; | ||
export default _default; |
@@ -14,12 +14,17 @@ "use strict"; | ||
const path = require("path"); | ||
const pathTemp = require("path-temp"); | ||
const rimraf = require("rimraf-then"); | ||
exports.default = () => { | ||
return { | ||
git: function fetchFromGit(resolution, dest) { | ||
git: function fetchFromGit(resolution, targetFolder) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
yield execGit(['clone', resolution.repo, dest]); | ||
yield execGit(['checkout', resolution.commit], { cwd: dest }); | ||
const tempLocation = pathTemp(targetFolder); | ||
yield execGit(['clone', resolution.repo, tempLocation]); | ||
yield execGit(['checkout', resolution.commit], { cwd: tempLocation }); | ||
// removing /.git to make directory integrity calculation faster | ||
yield rimraf(path.join(dest, '.git')); | ||
return dint.from(dest); | ||
yield rimraf(path.join(tempLocation, '.git')); | ||
return { | ||
filesIndex: yield dint.from(tempLocation), | ||
tempLocation, | ||
}; | ||
}); | ||
@@ -26,0 +31,0 @@ }, |
{ | ||
"name": "@pnpm/git-fetcher", | ||
"version": "0.2.0", | ||
"version": "0.3.1", | ||
"description": "A fetcher for git-hosted packages", | ||
@@ -11,3 +11,3 @@ "main": "lib/index.js", | ||
"scripts": { | ||
"test": "npm run lint", | ||
"test": "npm run lint && preview && ts-node test --type-check", | ||
"lint": "tslint -c tslint.json --project .", | ||
@@ -35,9 +35,16 @@ "tsc": "rimraf lib && tsc", | ||
"dependencies": { | ||
"@types/node": "^8.0.53", | ||
"@types/node": "^9.3.0", | ||
"dint": "^2.0.0", | ||
"execa": "^0.8.0", | ||
"execa": "^0.9.0", | ||
"path-temp": "^1.0.0", | ||
"rimraf-then": "^1.0.1" | ||
}, | ||
"devDependencies": { | ||
"@types/tape": "^4.2.31", | ||
"@types/tempy": "^0.1.0", | ||
"package-preview": "^1.0.5", | ||
"rimraf": "^2.6.2", | ||
"tape": "^4.8.0", | ||
"tempy": "^0.2.1", | ||
"ts-node": "^4.1.0", | ||
"tslint": "^5.8.0", | ||
@@ -44,0 +51,0 @@ "typescript": "^2.6.2" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
5807
49
5
9
1
0
+ Addedpath-temp@^1.0.0
+ Added@types/node@9.6.61(transitive)
+ Addedcrypto-random-string@1.0.0(transitive)
+ Addedexeca@0.9.0(transitive)
+ Addedpath-temp@1.0.0(transitive)
+ Addedunique-string@1.0.0(transitive)
- Removed@types/node@8.10.66(transitive)
- Removedexeca@0.8.0(transitive)
Updated@types/node@^9.3.0
Updatedexeca@^0.9.0