Skip to content

Commit 801f0a1

Browse files
committed
fixes for baseline and buidlname
1 parent 518309f commit 801f0a1

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

src/commander/uploadFigma.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ command
1818
.description('Capture screenshots of static sites')
1919
.argument('<file>', 'figma design config file')
2020
.option('--markBaseline', 'Mark the uploaded images as baseline')
21+
.option('--buildName <buildName>' , 'Name of the build')
2122
.action(async function(file, _, command) {
2223
let ctx: Context = ctxInit(command.optsWithGlobals());
2324

@@ -39,7 +40,6 @@ command
3940
let tasks = new Listr<Context>(
4041
[
4142
auth(ctx),
42-
getGitInfo(ctx),
4343
uploadFigmaDesigns(ctx)
4444
],
4545
{

src/lib/ctx.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ export default (options: Record<string, string>): Context => {
7474
args: {},
7575
options: {
7676
parallel: options.parallel ? true : false,
77-
markBaseline: options.markBaseline ? true : false
77+
markBaseline: options.markBaseline ? true : false,
78+
buildName: options.buildName || ''
7879
},
7980
cliVersion: version,
8081
totalSnapshots: -1

src/lib/httpClient.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,16 +137,17 @@ export default class httpClient {
137137
}, log)
138138
}
139139

140-
getFigmaFilesAndImages(figmaFileToken: string, figmaToken: String | undefined, queryParams: string, authToken: string, depth: number, git : any, markBaseline: boolean,log: Logger) {
140+
getFigmaFilesAndImages(figmaFileToken: string, figmaToken: String | undefined, queryParams: string, authToken: string, depth: number, markBaseline: boolean, buildName: string, log: Logger) {
141141
const requestBody = {
142142
figma_file_token: figmaFileToken,
143143
figma_token: figmaToken,
144144
query_params: queryParams,
145145
auth: authToken,
146146
depth: depth,
147-
markBaseline: markBaseline,
148-
git: git
147+
mark_base_line: markBaseline,
148+
build_name: buildName
149149
};
150+
150151
return this.request({
151152
url: "/uploadfigma",
152153
method: "POST",

src/lib/uploadFigmaDesigns.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default async (ctx: Context): Promise<string> => {
66
let results = "";
77
let figmaFileToken = '';
88
const markBaseline = ctx.options.markBaseline;
9-
9+
const buildName = ctx.options.buildName;
1010

1111
for (const config of figmaConfigs) {
1212

@@ -19,7 +19,7 @@ export default async (ctx: Context): Promise<string> => {
1919

2020
const authToken = `Basic ${Buffer.from(`${ctx.env.LT_USERNAME}:${ctx.env.LT_ACCESS_KEY}`).toString("base64")}`
2121

22-
const responseData = await ctx.client.getFigmaFilesAndImages(figmaFileToken, ctx.env.FIGMA_TOKEN, queryParams, authToken, depth, ctx.git, markBaseline, ctx.log)
22+
const responseData = await ctx.client.getFigmaFilesAndImages(figmaFileToken, ctx.env.FIGMA_TOKEN, queryParams, authToken, depth, markBaseline, buildName ,ctx.log);
2323

2424
if (responseData.data.message == "success") {
2525
results = responseData.data.message;

src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export interface Context {
2929
options: {
3030
parallel?: boolean,
3131
markBaseline?: boolean,
32+
buildName?: string,
3233
}
3334
cliVersion: string;
3435
totalSnapshots: number;

0 commit comments

Comments
 (0)