Skip to content

Commit

Permalink
remove packageJson.name from installationId
Browse files Browse the repository at this point in the history
  • Loading branch information
Amplifiyer committed Nov 16, 2023
1 parent 95e11a0 commit 442ffc5
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/platform-core/src/usage-data/get_installation_id.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
import { userInfo } from 'os';
import { v5 as uuidV5 } from 'uuid';
import { CwdPackageJsonReader } from '../cwd_package_json_reader.js';

// eslint-disable-next-line spellcheck/spell-checker
const AMPLIFY_CLI_UUID_NAMESPACE = 'e7368840-2eb6-4042-99b4-9d6c2a9370e6'; // A random v4 UUID
/**
* Generates a consistent installation Uuid from the cwd + packageJsonName + userName
* Generates a consistent installation Uuid from the library installation path + userName
*/
export const getInstallationUuid = (
namespace: string = AMPLIFY_CLI_UUID_NAMESPACE
) => {
const packageJsonName = new CwdPackageJsonReader().read().name;
const userName = userInfo().username;
const modulePath = __dirname;

return uuidV5(modulePath + packageJsonName + userName, namespace);
return uuidV5(modulePath + userName, namespace);
};

0 comments on commit 442ffc5

Please sign in to comment.