From 9cbceed6b859cf77691ec7efdebadcfc6efa4523 Mon Sep 17 00:00:00 2001 From: Roland Rodriguez Date: Thu, 25 Jul 2024 05:39:19 -0600 Subject: [PATCH] feat: Improve logging and code readability Refactor the assignment of `platformSpecificPackageName` in index.js for better readability. Add console logs in install.js to provide more information about binary distribution version and download URL during dependency installation. --- index.js | 3 +-- install.js | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 5e476fb..7399b60 100644 --- a/index.js +++ b/index.js @@ -13,8 +13,7 @@ const BINARY_DISTRIBUTION_PACKAGES = { const binaryName = process.platform === "win32" ? "paseto_cli.exe" : "paseto_cli"; // Determine package name for this platform -const platformSpecificPackageName = - BINARY_DISTRIBUTION_PACKAGES[process.platform]; +const platformSpecificPackageName = BINARY_DISTRIBUTION_PACKAGES[process.platform]; function getBinaryPath() { try { diff --git a/install.js b/install.js index 25fd870..8e016b8 100644 --- a/install.js +++ b/install.js @@ -29,6 +29,8 @@ function makeRequest(url) { return new Promise((resolve, reject) => { https .get(url, (response) => { + console.log(`Using binary distribution version: ${BINARY_DISTRIBUTION_VERSION}`); + console.log(`Attempting to download dependency from ${url}`); if (response.statusCode >= 200 && response.statusCode < 300) { const chunks = []; response.on("data", (chunk) => chunks.push(chunk));