now adding token correctly
This commit is contained in:
parent
ed0c947a2e
commit
e43322defd
6
dist/index.js
vendored
6
dist/index.js
vendored
@ -1,8 +1,8 @@
|
||||
var projectinfo = {};
|
||||
//classes
|
||||
var ProjectinfoNPM = require("./projectinfo.npm");
|
||||
projectinfo.npm = function (cwdArg) {
|
||||
return new ProjectinfoNPM(cwdArg);
|
||||
projectinfo.npm = function (cwdArg, optionsArg) {
|
||||
return new ProjectinfoNPM(cwdArg, optionsArg);
|
||||
};
|
||||
//quick functions
|
||||
projectinfo.getName = function (cwdArg) {
|
||||
@ -13,4 +13,4 @@ projectinfo.getName = function (cwdArg) {
|
||||
};
|
||||
module.exports = projectinfo;
|
||||
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBLElBQUksV0FBVyxHQUFPLEVBQUUsQ0FBQztBQUV6QixTQUFTO0FBQ1QsSUFBTyxjQUFjLFdBQVcsbUJBQW1CLENBQUMsQ0FBQztBQUNyRCxXQUFXLENBQUMsR0FBRyxHQUFHLFVBQVMsTUFBTTtJQUM3QixNQUFNLENBQUMsSUFBSSxjQUFjLENBQUMsTUFBTSxDQUFDLENBQUM7QUFDdEMsQ0FBQyxDQUFDO0FBRUYsaUJBQWlCO0FBQ2pCLFdBQVcsQ0FBQyxPQUFPLEdBQUcsVUFBUyxNQUFNO0lBQ2pDLElBQUksUUFBUSxHQUFHLFdBQVcsQ0FBQyxHQUFHLENBQUMsTUFBTSxDQUFDLENBQUM7SUFDdkMsRUFBRSxDQUFDLENBQUMsUUFBUSxDQUFDLE1BQU0sS0FBSyxJQUFJLENBQUMsQ0FBQSxDQUFDO1FBQzFCLE1BQU0sQ0FBQyxRQUFRLENBQUMsSUFBSSxDQUFDO0lBQ3pCLENBQUM7QUFDTCxDQUFDLENBQUM7QUFZRixpQkFBUyxXQUFXLENBQUMiLCJmaWxlIjoiaW5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ICAgaWYgKGxvY2FsTnBtLnN0YXR1cyA9PT0gXCJva1wiKXtcbiAgICAgICAgcmV0dXJuIGxvY2FsTnBtLm5hbWU7XG4gICAgfVxufTtcblxuLyogVE9ET1xucHJvamVjdGluZm8uZ2l0ID0gZnVuY3Rpb24oKXtcblxufTtcblxucHJvamVjdGluZm8ubW9qbyA9IGZ1bmN0aW9uKCl7XG5cbn07XG4qL1xuXG5leHBvcnQgPSBwcm9qZWN0aW5mbzsiXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=
|
||||
|
7
dist/projectinfo.npm.js
vendored
7
dist/projectinfo.npm.js
vendored
@ -1,14 +1,15 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
var plugins = require("./projectinfo.plugins");
|
||||
var ProjectinfoNPM = (function () {
|
||||
function ProjectinfoNPM(cwdArg) {
|
||||
function ProjectinfoNPM(cwdArg, optionsArg) {
|
||||
if (optionsArg === void 0) { optionsArg = {}; }
|
||||
this.packageJson = plugins.smartfile.readFileToObject(plugins.path.join(plugins.path.resolve(cwdArg), "package.json"));
|
||||
this.name = this.packageJson.name;
|
||||
this.version = this.packageJson.version;
|
||||
this.status = "ok";
|
||||
this.license = this.packageJson.license;
|
||||
if (this.packageJson.repository) {
|
||||
this.git = plugins.smartstring.git(this.packageJson.repository.url);
|
||||
this.git = plugins.smartstring.git(this.packageJson.repository.url, optionsArg.gitAccessToken);
|
||||
}
|
||||
;
|
||||
}
|
||||
@ -16,4 +17,4 @@ var ProjectinfoNPM = (function () {
|
||||
})();
|
||||
module.exports = ProjectinfoNPM;
|
||||
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInByb2plY3RpbmZvLm5wbS50cyJdLCJuYW1lcyI6WyJQcm9qZWN0aW5mb05QTSIsIlByb2plY3RpbmZvTlBNLmNvbnN0cnVjdG9yIl0sIm1hcHBpbmdzIjoiQUFBQSw0Q0FBNEM7QUFDNUMsSUFBTyxPQU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gICAgICAgICAgKVxuICAgICAgICApO1xuICAgICAgICB0aGlzLm5hbWUgPSB0aGlzLnBhY2thZ2VKc29uLm5hbWU7XG4gICAgICAgIHRoaXMudmVyc2lvbiA9IHRoaXMucGFja2FnZUpzb24udmVyc2lvbjtcbiAgICAgICAgdGhpcy5zdGF0dXMgPSBcIm9rXCI7XG4gICAgICAgIHRoaXMubGljZW5zZSA9IHRoaXMucGFja2FnZUpzb24ubGljZW5zZTtcbiAgICAgICAgaWYgKHRoaXMucGFja2FnZUpzb24ucmVwb3NpdG9yeSl7XG4gICAgICAgICAgICB0aGlzLmdpdCA9IHBsdWdpbnMuc21hcnRzdHJpbmcuZ2l0KHRoaXMucGFja2FnZUpzb24ucmVwb3NpdG9yeS51cmwsb3B0aW9uc0FyZy5naXRBY2Nlc3NUb2tlbik7XG4gICAgICAgIH07XG5cbiAgICB9XG59XG5cbmV4cG9ydCA9IFByb2plY3RpbmZvTlBNOyJdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ==
|
||||
|
@ -5,7 +5,7 @@ var path = require("path");
|
||||
var testBasePath = path.resolve(__dirname);
|
||||
describe("projectinfo", function () {
|
||||
describe(".npm() return", function () {
|
||||
var myNpm = projectinfo.npm(testBasePath);
|
||||
var myNpm = projectinfo.npm(testBasePath, { gitAccessToken: "sometoken" });
|
||||
it("should have .packageJson", function () {
|
||||
myNpm.packageJson
|
||||
.should.have.property("version", "1.0.0");
|
||||
@ -26,7 +26,7 @@ describe("projectinfo", function () {
|
||||
});
|
||||
it("should have .git", function () {
|
||||
myNpm.git.httpsUrl
|
||||
.should.equal("https://github.com/someuser/somerepo.git");
|
||||
.should.equal("https://sometoken@github.com/someuser/somerepo.git");
|
||||
});
|
||||
});
|
||||
describe(".getName()", function () {
|
||||
@ -37,4 +37,4 @@ describe("projectinfo", function () {
|
||||
});
|
||||
});
|
||||
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlc3Q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vdWxkLmhhdmUucHJvcGVydHkoXCJ2ZXJzaW9uXCIsXCIxLjAuMFwiKVxuICAgICAgICB9KTtcblxuICAgICAgICBpdChcInNob3VsZCBoYXZlIC5uYW1lXCIsZnVuY3Rpb24oKXtcbiAgICAgICAgICAgIG15TnBtXG4gICAgICAgICAgICAgICAgLnNob3VsZC5oYXZlLnByb3BlcnR5KFwibmFtZVwiLFwidGVzdHBhY2thZ2VcIik7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIGl0KFwic2hvdWxkIGhhdmUgLmxpY2Vuc2VcIixmdW5jdGlvbigpe1xuICAgICAgICAgICAgbXlOcG1cbiAgICAgICAgICAgICAgICAuc2hvdWxkLmhhdmUucHJvcGVydHkoXCJsaWNlbnNlXCIsXCJNSVRcIik7XG4gICAgICAgIH0pO1xuICAgICAgICBpdChcInNob3VsZCBoYXZlIC5naXRcIixmdW5jdGlvbigpe1xuICAgICAgICAgICAgbXlOcG0uZ2l0Lmh0dHBzVXJsXG4gICAgICAgICAgICAgICAgLnNob3VsZC5lcXVhbChcImh0dHBzOi8vc29tZXRva2VuQGdpdGh1Yi5jb20vc29tZXVzZXIvc29tZXJlcG8uZ2l0XCIpO1xuICAgICAgICB9KTtcblxuICAgIH0pO1xuXG4gICAgZGVzY3JpYmUoXCIuZ2V0TmFtZSgpXCIsZnVuY3Rpb24oKXtcbiAgICAgICAgaXQoXCJzaG91bGQgcmV0dXJuIGEgbmFtZVwiLGZ1bmN0aW9uKCl7XG4gICAgICAgICAgICBwcm9qZWN0aW5mby5nZXROYW1lKHRlc3RCYXNlUGF0aClcbiAgICAgICAgICAgICAgICAuc2hvdWxkLmVxdWFsKFwidGVzdHBhY2thZ2VcIik7XG4gICAgICAgIH0pO1xuICAgIH0pXG59KTsiXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD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CAAC,sBAAsB,EAAC;YACtB,KAAK;iBACA,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAC,KAAK,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,kBAAkB,EAAC;YAClB,KAAK,CAAC,GAAG,CAAC,QAAQ;iBACb,MAAM,CAAC,KAAK,CAAC,oDAAoD,CAAC,CAAC;QAC5E,CAAC,CAAC,CAAC;IAEP,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,YAAY,EAAC;QAClB,EAAE,CAAC,sBAAsB,EAAC;YACtB,WAAW,CAAC,OAAO,CAAC,YAAY,CAAC;iBAC5B,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAA;AACN,CAAC,CAAC,CAAC"}
|
@ -6,7 +6,7 @@ var testBasePath = path.resolve(__dirname);
|
||||
|
||||
describe("projectinfo",function(){
|
||||
describe(".npm() return",function(){
|
||||
var myNpm = projectinfo.npm(testBasePath);
|
||||
var myNpm = projectinfo.npm(testBasePath,{gitAccessToken:"sometoken"});
|
||||
it("should have .packageJson",function(){
|
||||
myNpm.packageJson
|
||||
.should.have.property("version","1.0.0");
|
||||
@ -30,7 +30,7 @@ describe("projectinfo",function(){
|
||||
});
|
||||
it("should have .git",function(){
|
||||
myNpm.git.httpsUrl
|
||||
.should.equal("https://github.com/someuser/somerepo.git");
|
||||
.should.equal("https://sometoken@github.com/someuser/somerepo.git");
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -4,8 +4,8 @@ var projectinfo:any = {};
|
||||
|
||||
//classes
|
||||
import ProjectinfoNPM = require("./projectinfo.npm");
|
||||
projectinfo.npm = function(cwdArg){
|
||||
return new ProjectinfoNPM(cwdArg);
|
||||
projectinfo.npm = function(cwdArg,optionsArg){
|
||||
return new ProjectinfoNPM(cwdArg,optionsArg);
|
||||
};
|
||||
|
||||
//quick functions
|
||||
|
@ -8,7 +8,7 @@ class ProjectinfoNPM {
|
||||
license:string;
|
||||
git;
|
||||
|
||||
constructor(cwdArg:string){
|
||||
constructor(cwdArg:string,optionsArg:{gitAccessToken?:string} = {}){
|
||||
this.packageJson = plugins.smartfile.readFileToObject(
|
||||
plugins.path.join(
|
||||
plugins.path.resolve(cwdArg),
|
||||
@ -20,7 +20,7 @@ class ProjectinfoNPM {
|
||||
this.status = "ok";
|
||||
this.license = this.packageJson.license;
|
||||
if (this.packageJson.repository){
|
||||
this.git = plugins.smartstring.git(this.packageJson.repository.url);
|
||||
this.git = plugins.smartstring.git(this.packageJson.repository.url,optionsArg.gitAccessToken);
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user