Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cf-deployment-tracker-client

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cf-deployment-tracker-client - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

8

package.json
{
"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;
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc