-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove packageJson.name from installationId
- Loading branch information
1 parent
95e11a0
commit 442ffc5
Showing
1 changed file
with
2 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}; |