Skip to content

Commit

Permalink
analytics directory bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zateutsch committed Sep 18, 2023
1 parent 1355b26 commit 9dae989
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions apps/cli/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apps/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pwabuilder/cli",
"version": "0.0.13",
"version": "0.0.14",
"description": "",
"main": "dist/index.js",
"files": [
Expand Down
4 changes: 3 additions & 1 deletion apps/cli/src/analytics/usage-analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import * as os from 'os';
import * as fs from 'fs';
import { doesFileExist } from '../util/fileUtil';
import { spawn } from 'child_process';
const path = require('node:path');

export interface CreateEventData {
template: string
Expand Down Expand Up @@ -114,7 +115,8 @@ function spawnAnalyticsProcess(event: string, properties?: any) {
}

function resolveNodeSpawnArgs(event: string, properties?: any): string [] {
return properties ? ['tack-event.js', event] : ['tack-event.js', event, JSON.stringify(properties)];
const scriptPath: string = path.resolve(__dirname, 'track-events.js')
return properties ? [scriptPath, event] : [scriptPath, event, JSON.stringify(properties)];
}

export function trackErrorWrapper(_error: Error): void {
Expand Down

0 comments on commit 9dae989

Please sign in to comment.