Skip to content

Commit

Permalink
fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
coffeephile committed Jan 17, 2025
1 parent f988e39 commit 581fbd0
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/app/commands/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export type CreateAppOptions = {
name: string;
endpointUrl: string;
viewType: string;
}
};

export const createLiffApp = async (options: CreateAppOptions) => {
const accessToken = (await resolveChannel(options?.channelId))?.accessToken;
Expand All @@ -29,8 +29,8 @@ export const createLiffApp = async (options: CreateAppOptions) => {
description: options.name,
});

return liffId
}
return liffId;
};

const createAction = async (options: CreateAppOptions) => {
const liffId = await createLiffApp(options);
Expand Down
4 changes: 3 additions & 1 deletion src/channel/commands/add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import inquirer from "inquirer";

import { renewAccessToken } from "../renewAccessToken.js";

export const addAction: (channelId?: string) => Promise<void> = async (channelId) => {
export const addAction: (channelId?: string) => Promise<void> = async (
channelId,
) => {
if (!channelId) {
throw new Error("Channel ID is required.");
}
Expand Down
13 changes: 9 additions & 4 deletions src/init/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { Command } from "commander";
import { addAction as addChannelAction } from "../channel/commands/add.js";
import { execSync } from 'child_process';
import { execSync } from "child_process";
import { CreateAppOptions, createLiffApp } from "../app/commands/create.js";

const addAction: (options: CreateAppOptions) => Promise<void> = async (options) => {
const addAction: (options: CreateAppOptions) => Promise<void> = async (
options,
) => {
if (!options.channelId) {
throw new Error("Channel ID is required.");
}
Expand All @@ -17,7 +19,9 @@ const addAction: (options: CreateAppOptions) => Promise<void> = async (options)
const liffId = await createLiffApp(options);

// 3. create liff app (@ client)
execSync(`npx @line/create-liff-app ${options.name} -l ${liffId}`, {stdio: 'inherit'});
execSync(`npx @line/create-liff-app ${options.name} -l ${liffId}`, {
stdio: "inherit",
});

// 4. print instructions on how to run locally
console.info(`App ${liffId} successfully created.
Expand All @@ -34,7 +38,8 @@ Now do the following:

export const installInitCommands = (program: Command) => {
const app = program.command("init");
app.description("Initialize new LIFF app")
app
.description("Initialize new LIFF app")
.option(
"-c, --channel-id [channelId]",
"The channel ID to use. If it isn't specified, the currentChannelId's will be used.",
Expand Down
2 changes: 1 addition & 1 deletion src/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { serveCommands } from "./serve/index.js";
export const setupCLI = (program: Command) => {
installChannelCommands(program);
installAppCommands(program);
installInitCommands(program)
installInitCommands(program);
serveCommands(program);
// TODO .version?
return {
Expand Down

0 comments on commit 581fbd0

Please sign in to comment.