Skip to content

Commit

Permalink
modify the sentences which is changed accidentally
Browse files Browse the repository at this point in the history
  • Loading branch information
To-Ki-O committed Feb 25, 2023
1 parent 6eb66a0 commit b442585
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions libs/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ export class InstallAction {
console.log(Colors.red("The -n option is not specified."));
Deno.exit(1);
}
const targetLockContent = new DimFileAccessor().getContents().find((c) => c.name === options.name);
if (targetLockContent !== undefined && !options.force) {
const targetContent = new DimFileAccessor().getContents().find((c) => c.name === options.name);
if (targetContent !== undefined && !options.force) {
console.log(Colors.red("The name already exists."));
console.log(
Colors.red(
Expand Down Expand Up @@ -106,7 +106,7 @@ export class UninstallAction {
);
}
const dimLockFileAccessor = new DimLockFileAccessor();
const targetLockContent = dimLockFileAccessor.getContents().find((c) => c.name === name);
const targetContent = dimLockFileAccessor.getContents().find((c) => c.name === name);
const isRemovedDimLockFile = await dimLockFileAccessor.removeContent(name);
if (isRemovedDimLockFile) {
console.log(
Expand All @@ -119,16 +119,16 @@ export class UninstallAction {
),
);
}
if (targetLockContent !== undefined) {
if (targetContent !== undefined) {
try {
Deno.statSync(targetLockContent.path);
await Deno.remove(targetLockContent.path);
Deno.statSync(targetContent.path);
await Deno.remove(targetContent.path);
console.log(
Colors.green(`Removed a file '${targetLockContent.path}'.`),
Colors.green(`Removed a file '${targetContent.path}'.`),
);
} catch {
console.log(
Colors.red(`Failed to remove a file '${targetLockContent.path}'.`),
Colors.red(`Failed to remove a file '${targetContent.path}'.`),
);
}
// TODO: Remove an empty direcotory
Expand Down

0 comments on commit b442585

Please sign in to comment.