Skip to content

Commit

Permalink
feat: 属性判空
Browse files Browse the repository at this point in the history
  • Loading branch information
geekdada committed Aug 25, 2019
1 parent c2eeb29 commit 13eb455
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ export async function generate(config: CommandConfig, artifact: ArtifactConfig):
provider,
customParams,
} = artifact;

assert(artifactName, 'You must specify the artifact\'s name.');
assert(template, 'You must specify the artifact\'s template.');
assert(provider, 'You must specify the artifact\'s provider.');

const tplBuffer = await fs.readFile(path.resolve(config.templateDir, `${template}.tpl`));
const recipeList = artifact.recipe ? artifact.recipe : [artifact.provider];
const nodeList: PossibleNodeConfigType[] = [];
Expand Down

0 comments on commit 13eb455

Please sign in to comment.