Skip to content

Commit

Permalink
feat: Improve logging and code readability
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rrrodzilla committed Jul 25, 2024
1 parent 006f1a4 commit 9cbceed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 1 addition & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 2 additions & 0 deletions install.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 9cbceed

Please sign in to comment.