From dbdf7e346cb1e88096bdb1d374a19880000a8067 Mon Sep 17 00:00:00 2001 From: Pine Date: Wed, 20 Nov 2024 22:40:42 -0700 Subject: [PATCH 1/2] feat: set scarfSettings.allowTopLevel to track modus-cli install through curl --- cli/package.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cli/package.json b/cli/package.json index 85264711f..74007b86b 100644 --- a/cli/package.json +++ b/cli/package.json @@ -84,5 +84,8 @@ "additionalVersionFlags": [ "-v" ] + }, + "scarfSettings": { + "allowTopLevel": true } } From 2f8c8e5bc8fcd7760eb078493ef662fcc1494166 Mon Sep 17 00:00:00 2001 From: Pine Date: Thu, 21 Nov 2024 09:40:28 -0700 Subject: [PATCH 2/2] normalize all scarf variables --- cli/src/commands/new/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cli/src/commands/new/index.ts b/cli/src/commands/new/index.ts index 260a2074b..36b325c34 100644 --- a/cli/src/commands/new/index.ts +++ b/cli/src/commands/new/index.ts @@ -171,7 +171,9 @@ export default class NewCommand extends BaseCommand { const arch = os.arch(); const nodeVersion = process.version; - await http.get(`https://${SCARF_ENDPOINT}.scarf.sh/${version}/${platform}/${arch}/${nodeVersion}/${sdk}/${sdkVersion}`); + const variables: string[] = [version.toLowerCase(), platform.toLowerCase(), arch.toLowerCase(), nodeVersion.toLowerCase(), sdk.toLowerCase(), sdkVersion.toLowerCase()]; + + await http.get(`https://${SCARF_ENDPOINT}.scarf.sh/${variables.join("/")}`); } } catch (_error) { // Fail silently if an error occurs during the analytics call