Skip to content
This repository was archived by the owner on Apr 13, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions src/commands/ring/delete.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-use-before-define */
import commander from "commander";
import * as bedrock from "../../lib/bedrockYaml";
import { build as buildCmd, exit as exitCmd } from "../../lib/commandBuilder";
Expand All @@ -9,6 +8,17 @@ import { logger } from "../../logger";
import { BedrockFileInfo } from "../../types";
import decorator from "./delete.decorator.json";

/**
* Check the bedrock.yaml and the target ring exists
* @param projectPath
*/
export const checkDependencies = (projectPath: string): void => {
const fileInfo: BedrockFileInfo = bedrock.fileInfo(projectPath);
if (fileInfo.exist === false) {
throw Error(PROJECT_INIT_DEPENDENCY_ERROR_MESSAGE);
}
};

/**
* Executes the command.
*
Expand Down Expand Up @@ -63,14 +73,3 @@ export const commandDecorator = (command: commander.Command): void => {
});
});
};

/**
* Check the bedrock.yaml and the target ring exists
* @param projectPath
*/
export const checkDependencies = (projectPath: string): void => {
const fileInfo: BedrockFileInfo = bedrock.fileInfo(projectPath);
if (fileInfo.exist === false) {
throw Error(PROJECT_INIT_DEPENDENCY_ERROR_MESSAGE);
}
};
23 changes: 11 additions & 12 deletions src/commands/ring/set-default.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-use-before-define */
import commander from "commander";
import {
fileInfo as bedrockFileInfo,
Expand All @@ -12,6 +11,17 @@ import { logger } from "../../logger";
import { BedrockFileInfo } from "../../types";
import decorator from "./set-default.decorator.json";

/**
* Check for bedrock.yaml
* @param projectPath
*/
export const checkDependencies = (projectPath: string): void => {
const fileInfo: BedrockFileInfo = bedrockFileInfo(projectPath);
if (fileInfo.exist === false) {
throw new Error(PROJECT_INIT_DEPENDENCY_ERROR_MESSAGE);
}
};

/**
* Executes the command.
*
Expand Down Expand Up @@ -53,14 +63,3 @@ export const commandDecorator = (command: commander.Command): void => {
});
});
};

/**
* Check for bedrock.yaml
* @param projectPath
*/
export const checkDependencies = (projectPath: string): void => {
const fileInfo: BedrockFileInfo = bedrockFileInfo(projectPath);
if (fileInfo.exist === false) {
throw new Error(PROJECT_INIT_DEPENDENCY_ERROR_MESSAGE);
}
};