create-simple-projects
Version:
Create simple project with ts, jest, eslint, prettier and other stuff.
29 lines (24 loc) • 634 B
text/typescript
import * as path from 'path';
import { Answers } from './inquirer';
export interface OptionPlaceholders {
PROJECT_NAME: string;
}
export interface Options {
placeholders: OptionPlaceholders;
templateName: string;
templatePath: string;
targetPath: string;
}
export function createOptionsFromAnswers(answers: Answers): Options {
const { template, name } = answers;
const templatePath = path.join(__dirname, '../templates', template);
const targetPath = path.join(process.cwd(), name);
return {
templateName: template,
templatePath,
targetPath,
placeholders: {
PROJECT_NAME: name
}
};
}