Skip to content
This repository has been archived by the owner on Sep 12, 2019. It is now read-only.

Update telemetry #85

Merged
merged 3 commits into from
Apr 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/commands/dev/exec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const execa = require("execa");
const Command = require("@netlify/cli-utils");
const { track } = require("@netlify/cli-utils/src/utils/telemetry");

class ExecCommand extends Command {
async run() {
Expand All @@ -13,6 +14,10 @@ class ExecCommand extends Command {
env: process.env,
stdio: "inherit"
});
// Todo hoist this telemetry `command` to CLI hook
track("command", {
command: "dev:exec"
});
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/commands/dev/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ class DevCommand extends Command {
// Todo hoist this telemetry `command` to CLI hook
track("command", {
command: "dev",
projectType: settings.type || "custom"
projectType: settings.type || "custom",
live: flags.live || false
});

const banner = chalk.bold(`Netlify dev server is now ready on ${url}`);
Expand Down
5 changes: 5 additions & 0 deletions src/commands/functions/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const fetch = require("node-fetch");
const cp = require("child_process");
const { createAddon } = require("netlify/src/addons");
const ora = require("ora");
const { track } = require("@netlify/cli-utils/src/utils/telemetry");

const templatesDir = path.resolve(__dirname, "../../functions-templates");

Expand All @@ -29,6 +30,10 @@ class FunctionsCreateCommand extends Command {
} else {
await scaffoldFromTemplate.call(this, flags, args, functionsDir);
}
track("command", {
command: "functions:create",
url: flags.url
});
}
}

Expand Down