get-price-tag
Advanced tools
Comparing version 0.1.12 to 0.1.13
{ | ||
"name": "get-price-tag", | ||
"version": "0.1.12", | ||
"version": "0.1.13", | ||
"main": "dist/commonjs/index.js", | ||
@@ -5,0 +5,0 @@ "types": "dist/index.d.ts", |
@@ -11,5 +11,5 @@ import fetch from "node-fetch"; | ||
let results = []; | ||
// Print out the name of the package that was just installed. | ||
let pkgName = ''; | ||
let vocaVersion = ''; | ||
// Print out the name of the package that was just installed. | ||
let pkgName = ""; | ||
let vocaVersion = ""; | ||
fs.readdir(rootDir, function (err, list) { | ||
@@ -35,13 +35,20 @@ if (err) return done(err); | ||
packageJSON = fileContents; | ||
if(/^get-price-tag$/.test(fileContents)) { | ||
if (/^get-price-tag$/.test(fileContents)) { | ||
const packageJSONParsed = JSON.parse(packageJSON); | ||
pkgName = packageJSONParsed.name; | ||
vocaVersion = packageJSONParsed.dependencies['get-price-tag'] | ||
vocaVersion = packageJSONParsed.dependencies["get-price-tag"]; | ||
fetch( | ||
"https://stats.api.voca.teliacompany.com/postintall/projects", | ||
{ | ||
method: "post", | ||
body: { | ||
voca_project: pkgName, | ||
voca_version: vocaVersion, | ||
voca_framework: "react", | ||
}, | ||
} | ||
); | ||
results.push(`${pkgName}, ${vocaVersion}`); | ||
} | ||
fetch("https://stats.api.voca.teliacompany.com/postintall/projects", { | ||
method: "post", | ||
body: { voca_project: pkgName, voca_version: vocaVersion, voca_framework: "react" }, | ||
}); | ||
results.push(`${pkgName}, ${vocaVersion}`) | ||
results.push( JSON.parse(packageJSON)); | ||
results.push(packageJSON); | ||
next(); | ||
@@ -48,0 +55,0 @@ } else { |
7695
162