Skip to content

Commit

Permalink
🧹 Clean up self reported client info
Browse files Browse the repository at this point in the history
  • Loading branch information
wwilsman committed Jul 31, 2020
1 parent eb07c01 commit 29aef0a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
10 changes: 7 additions & 3 deletions packages/cli-upload/src/commands/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import imageSize from 'image-size';
import PercyClient from '@percy/client';
import createImageResources from '../resources';
import { schema } from '../config';
import pkg from '../../package.json';

const ALLOWED_IMAGE_TYPES = /\.(png|jpg|jpeg)$/i;

Expand Down Expand Up @@ -75,11 +76,14 @@ export class Upload extends Command {

// we already have assets so we don't need asset discovery from @percy/core,
// we can use @percy/client directly to send snapshots
this.client = new PercyClient();
this.client = new PercyClient({
clientInfo: `${pkg.name}/${pkg.version}`
});

await this.client.createBuild();
log.info('Percy has started!');
let { build } = this.client;

let build = this.client.build;
log.info('Percy has started!');
log.info(`Created build #${build.number}: ${build.url}`);

for (let name of paths) {
Expand Down
7 changes: 1 addition & 6 deletions packages/core/src/percy.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import Queue from './queue';
import assert from './utils/assert';
import { createRootResource, createLogResource } from './utils/resources';
import { normalizeURL } from './utils/url';
import pkg from '../package.json';

// Register core config options
PercyConfig.addSchema(schema);
Expand Down Expand Up @@ -66,11 +65,7 @@ export default class Percy {
: PercyConfig.load({ path: config, overrides: options });

this.discoverer = new Discoverer(this.config.discovery);
this.client = new PercyClient({
clientInfo: [`${pkg.name}/${pkg.version}`].concat(clientInfo),
environmentInfo,
token
});
this.client = new PercyClient({ token, clientInfo, environmentInfo });
}

// Shortcut for controlling the global logger's log level.
Expand Down

0 comments on commit 29aef0a

Please sign in to comment.