Skip to content

Commit

Permalink
Format with Deno fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
ryo-ma committed Aug 18, 2022
1 parent 6a97ff7 commit 14535e6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
1 change: 0 additions & 1 deletion dim.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {
Command,
CompletionsCommand,
DenoLandProvider,
GithubProvider,
HelpCommand,
UpgradeCommand,
Expand Down
4 changes: 2 additions & 2 deletions libs/accessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class DimFileAccessor {
try {
Deno.statSync(path);
this.dimJSON = JSON.parse(Deno.readTextFileSync(path));
} catch (e) {
} catch {
console.log("Not found a dim.json. You should run a 'dim init'. ");
Deno.exit(1);
}
Expand Down Expand Up @@ -99,7 +99,7 @@ export class DimLockFileAccessor {
this.dimLockJSON = JSON.parse(
Deno.readTextFileSync(DEFAULT_DIM_LOCK_FILE_PATH),
);
} catch (e) {
} catch {
console.log("Not found a dim-lock.json");
Deno.exit(1);
}
Expand Down
18 changes: 9 additions & 9 deletions libs/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ const installFromURL = async (
) => {
await createDataFilesDir();
try {
Deno.statSync(DEFAULT_DIM_LOCK_FILE_PATH)
} catch (e) {
Deno.statSync(DEFAULT_DIM_LOCK_FILE_PATH);
} catch {
await initDimLockFile();
}

Expand Down Expand Up @@ -114,8 +114,8 @@ const installFromDimFile = async (
) => {
await createDataFilesDir();
try {
Deno.statSync(DEFAULT_DIM_LOCK_FILE_PATH)
} catch (e) {
Deno.statSync(DEFAULT_DIM_LOCK_FILE_PATH);
} catch {
await initDimLockFile();
}

Expand Down Expand Up @@ -143,7 +143,7 @@ const installFromDimFile = async (
}
const installList = contents.map((content) => {
return function () {
return new Promise<LockContent>(async (resolve) => {
return new Promise<LockContent>((resolve) => {
const consoleAnimation = new ConsoleAnimation(
["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"],
`Installing ${content.url} ...`,
Expand Down Expand Up @@ -329,7 +329,7 @@ export const parseHeader = function (
};

export class InitAction {
async execute(options: any) {
async execute() {
await createDataFilesDir();
await initDimFile();
await initDimLockFile();
Expand Down Expand Up @@ -412,7 +412,7 @@ export class InstallAction {
}

export class UninstallAction {
async execute(options: any, name: string) {
async execute(_: void, name: string) {
const isRemovedDimFile = await new DimFileAccessor().removeContent(name);
if (isRemovedDimFile) {
console.log(
Expand Down Expand Up @@ -441,12 +441,12 @@ export class UninstallAction {
}
if (targetContent !== undefined) {
try {
Deno.statSync(targetContent.path)
Deno.statSync(targetContent.path);
await Deno.remove(targetContent.path);
console.log(
Colors.green(`Removed a file '${targetContent.path}'.`),
);
} catch (e) {
} catch {
console.log(
Colors.red(`Failed to remove a file '${targetContent.path}'.`),
);
Expand Down

0 comments on commit 14535e6

Please sign in to comment.