Comparing version 1.1.3 to 1.1.4
@@ -35,7 +35,13 @@ "use strict"; | ||
try { | ||
const hostname = os.hostname(); | ||
const uniqueId = `${hostname}-${(0, uuid_1.v4)()}`; | ||
customFs.writeFileSync(ID_FILE, uniqueId, 'utf-8'); | ||
console.log(`Generated and saved new User ID: ${uniqueId}`); | ||
return uniqueId; | ||
if (customFs.existsSync(ID_FILE)) { | ||
console.log(`User ID file found at: ${ID_FILE}`); | ||
return customFs.readFileSync(ID_FILE, 'utf-8').trim(); | ||
} | ||
else { | ||
const hostname = os.hostname(); | ||
const uniqueId = `${hostname}-${(0, uuid_1.v4)()}`; | ||
customFs.writeFileSync(ID_FILE, uniqueId, 'utf-8'); | ||
console.log(`Generated and saved new User ID: ${uniqueId}`); | ||
return uniqueId; | ||
} | ||
} | ||
@@ -42,0 +48,0 @@ catch (error) { |
@@ -11,8 +11,13 @@ import * as fs from 'fs'; | ||
try { | ||
const hostname = os.hostname(); | ||
const uniqueId = `${hostname}-${uuidv4()}`; | ||
customFs.writeFileSync(ID_FILE, uniqueId, 'utf-8'); | ||
console.log(`Generated and saved new User ID: ${uniqueId}`); | ||
return uniqueId; | ||
if (customFs.existsSync(ID_FILE)) { | ||
console.log(`User ID file found at: ${ID_FILE}`); | ||
return customFs.readFileSync(ID_FILE, 'utf-8').trim(); | ||
} else { | ||
const hostname = os.hostname(); | ||
const uniqueId = `${hostname}-${uuidv4()}`; | ||
customFs.writeFileSync(ID_FILE, uniqueId, 'utf-8'); | ||
console.log(`Generated and saved new User ID: ${uniqueId}`); | ||
return uniqueId; | ||
} | ||
} catch (error) { | ||
@@ -19,0 +24,0 @@ console.error('Failed to generate or read unique ID:', error); |
{ | ||
"name": "pm2wick", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"description": "Manage your PM2 processes.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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
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
42915
910