Read templates relative to the root of project
Signed-off-by: Min Kim <minkimcello@gmail.com>
This commit is contained in:
@@ -68,10 +68,12 @@ export function verifyTemplate({ id, target }: TemplateLocation): Template {
|
||||
if (target.startsWith('http')) {
|
||||
throw new Error('Remote templates are not supported yet');
|
||||
}
|
||||
if (!fs.existsSync(target)) {
|
||||
if (!fs.existsSync(paths.resolveTargetRoot(target))) {
|
||||
throw new Error(`Your CLI template does not exist: ${target}`);
|
||||
}
|
||||
const template = parse(fs.readFileSync(target, 'utf-8'));
|
||||
const template = parse(
|
||||
fs.readFileSync(paths.resolveTargetRoot(target), 'utf-8'),
|
||||
);
|
||||
const templatePath = paths.resolveTargetRoot(
|
||||
dirname(target),
|
||||
template.template,
|
||||
|
||||
Reference in New Issue
Block a user