cf-deployment-tracker-client
Advanced tools
Comparing version 0.0.1 to 0.0.2
{ | ||
"name": "cf-deployment-tracker-client", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"private": false, | ||
"main": "tracker.js track", | ||
"scripts": { | ||
"start": "node tracker.js track" | ||
}, | ||
"main": "tracker.js", | ||
"repository": { | ||
@@ -14,3 +11,2 @@ "type": "git", | ||
"dependencies": { | ||
"commander": "*", | ||
"restler": "*" | ||
@@ -17,0 +13,0 @@ }, |
@@ -5,50 +5,42 @@ // Licensed under the Apache 2.0 License. See footer for details. | ||
restler = require("restler"), | ||
path = require("path"), | ||
program = require("commander"), | ||
pkg = require(path.join(__dirname, "package.json")); | ||
path = require("path"); | ||
var vcapApplication; | ||
function track() { | ||
var pkg = require(path.join(path.dirname(module.parent.filename), "package.json")), | ||
vcapApplication; | ||
if (process.env.VCAP_APPLICATION) { | ||
vcapApplication = JSON.parse(process.env.VCAP_APPLICATION); | ||
} | ||
if (process.env.VCAP_APPLICATION) { | ||
vcapApplication = JSON.parse(process.env.VCAP_APPLICATION); | ||
} | ||
program | ||
.command("track") | ||
.description("Track application deployments") | ||
.action(function(options) { | ||
if (vcapApplication) { | ||
var event = { | ||
date_sent: new Date().toJSON() | ||
}; | ||
if (pkg.version) { | ||
event.code_version = pkg.version; | ||
} | ||
if (pkg.repository && pkg.repository.url) { | ||
event.repository_url = pkg.repository.url; | ||
} | ||
if (vcapApplication.application_name) { | ||
event.application_name = vcapApplication.application_name; | ||
} | ||
if (vcapApplication.space_id) { | ||
event.space_id = vcapApplication.space_id; | ||
} | ||
if (vcapApplication.application_version) { | ||
event.application_version = vcapApplication.application_version; | ||
} | ||
if (vcapApplication.application_uris) { | ||
event.application_uris = vcapApplication.application_uris; | ||
} | ||
var url = "https://deployment-tracker.mybluemix.net/"; | ||
restler.postJson(url, event).on("complete", function (data) { | ||
console.log("Uplodaed stats"); | ||
}); | ||
if (vcapApplication) { | ||
var event = { | ||
date_sent: new Date().toJSON() | ||
}; | ||
if (pkg.version) { | ||
event.code_version = pkg.version; | ||
} | ||
}).on("--help", function() { | ||
console.log(" Examples:"); | ||
console.log(); | ||
console.log(" $ track"); | ||
console.log(); | ||
}); | ||
if (pkg.repository && pkg.repository.url) { | ||
event.repository_url = pkg.repository.url; | ||
} | ||
if (vcapApplication.application_name) { | ||
event.application_name = vcapApplication.application_name; | ||
} | ||
if (vcapApplication.space_id) { | ||
event.space_id = vcapApplication.space_id; | ||
} | ||
if (vcapApplication.application_version) { | ||
event.application_version = vcapApplication.application_version; | ||
} | ||
if (vcapApplication.application_uris) { | ||
event.application_uris = vcapApplication.application_uris; | ||
} | ||
console.log(event); | ||
var url = "https://deployment-tracker.mybluemix.net/api/v1/track"; | ||
restler.postJson(url, event).on("complete", function (data) { | ||
console.log("Uplodaed stats"); | ||
}); | ||
} | ||
} | ||
program.parse(process.argv); | ||
module.exports.track = track; |
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
1
2
14339
40
- Removedcommander@*
- Removedcommander@12.1.0(transitive)