Comparing version 1.0.1 to 1.0.3
@@ -84,3 +84,3 @@ var ClientLtk = require("./Client").Client | ||
result = | ||
gitPrefix + sshPrefix + "git@bitbucket.org:lotrek-tea/ltk-test.git" | ||
gitPrefix + sshPrefix + repo_url | ||
} | ||
@@ -87,0 +87,0 @@ return result |
@@ -38,2 +38,8 @@ var os = require("os") | ||
createFolder() { | ||
if (!fs.existsSync(this.path)) { | ||
fs.mkdirSync(this.path) | ||
} | ||
} | ||
fileExist() { | ||
@@ -58,2 +64,5 @@ if (fs.existsSync(this.path + this.file_name)) { | ||
let result = undefined | ||
if(!this.folderExist()){ | ||
this.createFolder() | ||
} | ||
try{ | ||
@@ -60,0 +69,0 @@ result = await fs.writeFile(this.path + this.file_name, preferences, err => { |
{ | ||
"name": "ltk-cli", | ||
"version": "1.0.1", | ||
"version": "1.0.3", | ||
"description": "Ltk client for private repo system", | ||
@@ -10,5 +10,3 @@ "main": "index.js", | ||
"preferGlobal": true, | ||
"bin": { | ||
"ltk": "./index.js" | ||
}, | ||
"bin": { "ltk": "./index.js" }, | ||
"dependencies": { | ||
@@ -27,5 +25,3 @@ "axios": "^0.17.1", | ||
}, | ||
"scripts": { | ||
"test": "mocha --timeout 25000" | ||
} | ||
"scripts": { "test": "mocha --timeout 25000" } | ||
} |
@@ -1,2 +0,3 @@ | ||
## LTK | ||
## LTK | ||
[![Build Status](https://travis-ci.org/ltkpm/ltk-client.svg?branch=master)](https://travis-ci.org/ltkpm/ltk-client) | ||
@@ -17,3 +18,3 @@ A **new way** to manage your private repository | ||
"name": "ltk-test", | ||
"url": "git@bitbucket.org:lotrek-tea/ltk-test.git", | ||
"url": "git@github.com:ltkpm/ltk-test.git", | ||
"type": "node", | ||
@@ -20,0 +21,0 @@ "version": 1, |
@@ -27,31 +27,35 @@ var axios = require("axios") | ||
it("[Node] Add ltk-test dependency", function(done) { | ||
const testPackage = { | ||
name: "ltk-test", | ||
url: "git@bitbucket.org:lotrek-tea/ltk-test.git", | ||
type: "node", | ||
version: 1, | ||
hash: | ||
"6ca47b2cb4d6a1886a6d2ca7d0cf1843450aff12478b7e8d9e10cbed18a81454d8c486c6aff6830428a16bfcd569628d9727924a03d5de8f2a8c632b87830e74" | ||
} | ||
packageManager.preference.url = url | ||
packageManager.preference.node = "npm" | ||
moxios.withMock(function() { | ||
let onFulfilled = sinon.spy() | ||
axios.get(packageManager.preference.url+"/api/repo/" + packageTest).then(onFulfilled) | ||
moxios.wait(function() { | ||
let request = moxios.requests.mostRecent() | ||
request.respondWith({ status: 200, response: { testPackage } }) | ||
.then((result)=>{ | ||
let urlRepo = result.data.testPackage.url | ||
console.log(urlRepo) | ||
packageManager.installNodeRepository(urlRepo,3) | ||
done() | ||
}).catch((error)=>{ | ||
console.log("error" + error) | ||
done() | ||
}) | ||
}) | ||
it("[Node] Add ltk-test dependency", function(done) { | ||
const testPackage = { | ||
name: "ltk-test", | ||
url: "git@github.com:ltkpm/ltk-test.git", | ||
type: "node", | ||
version: 1, | ||
hash: | ||
"6ca47b2cb4d6a1886a6d2ca7d0cf1843450aff12478b7e8d9e10cbed18a81454d8c486c6aff6830428a16bfcd569628d9727924a03d5de8f2a8c632b87830e74" | ||
} | ||
packageManager.preference.url = url | ||
packageManager.preference.node = "npm" | ||
moxios.withMock(function() { | ||
let onFulfilled = sinon.spy() | ||
axios | ||
.get(packageManager.preference.url + "/api/repo/" + packageTest) | ||
.then(onFulfilled) | ||
moxios.wait(function() { | ||
let request = moxios.requests.mostRecent() | ||
request | ||
.respondWith({ status: 200, response: { testPackage } }) | ||
.then(result => { | ||
let urlRepo = result.data.testPackage.url | ||
console.log(urlRepo) | ||
packageManager.installNodeRepository(urlRepo, 3) | ||
done() | ||
}) | ||
.catch(error => { | ||
console.log("error" + error) | ||
done() | ||
}) | ||
}) | ||
}) | ||
}) | ||
}) | ||
@@ -75,3 +79,3 @@ | ||
let promiseWrite = preference.savePreferences(JSON.stringify(defaultPref)) | ||
promiseWrite.then(()=>{ | ||
promiseWrite.then(() => { | ||
expect(fs.existsSync(path)).to.equal(true) | ||
@@ -91,7 +95,7 @@ }) | ||
let packageManager = undefined | ||
before(function () { | ||
before(function() { | ||
backup_file = require("../package.json") | ||
let tmp_file = backup_file | ||
backup_file = JSON.stringify(backup_file) | ||
tmp_file.dependencies["ltk-test"] = "git@bitbucket.org:lotrek-tea/ltk-test.git" | ||
backup_file = JSON.stringify(backup_file) | ||
tmp_file.dependencies["ltk-test"] = "git@github.com:ltkpm/ltk-test.git" | ||
fs.writeFileSync("package.json", JSON.stringify(tmp_file, null, "")) | ||
@@ -102,9 +106,7 @@ packageManager = new Manager() | ||
it("Remove ltk-test from package.json", () => { | ||
packageManager.removeNodeRepository("ltk-test",3) | ||
packageManager.removeNodeRepository("ltk-test", 3) | ||
}) | ||
after(() => { | ||
console.log(backup_file) | ||
fs.writeFileSync("package.json", backup_file) | ||
}) | ||
}) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
473
51
15657