chore(scaffolder): moving things around to make things work for the actually scaffoling
This commit is contained in:
+1
-1
@@ -9,4 +9,4 @@ sed -i -e "s/__component_id__/{{ cookiecutter.component_id }}/g" package.json
|
||||
mv ../../node_modules.tmp ../../\{\{cookiecutter.component_id\}\}/node_modules 2>/dev/null ||:
|
||||
|
||||
# move back the build directory that was moved out in the pre_gen hook (if it exists)
|
||||
mv ../../build.tmp ../../\{\{cookiecutter.component_id\}\}/build 2>/dev/null ||:
|
||||
mv ../../build.tmp ../../\{\{cookiecutter.component_id\}\}/build 2>/dev/null ||:
|
||||
|
||||
@@ -25,7 +25,7 @@ export class CookieCutter implements TemplaterBase {
|
||||
...options.values,
|
||||
};
|
||||
|
||||
await fs.writeJSON(options.directory, cookieInfo);
|
||||
await fs.writeJSON(`${options.directory}/cookiecutter.json`, cookieInfo);
|
||||
return '';
|
||||
// run cookie cutter with new json
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
export interface RequiredTemplateValues {
|
||||
componentId: string;
|
||||
component_id: string;
|
||||
}
|
||||
|
||||
export interface TemplaterRunOptions {
|
||||
|
||||
@@ -67,7 +67,9 @@ export async function createRouter(
|
||||
const path = await preparer.prepare(mockEntity);
|
||||
|
||||
// Run the templater on the mock directory with values from the post body
|
||||
await templater.run({ directory: path, values: { componentId: 'test' } });
|
||||
await templater.run({ directory: path, values: { component_id: 'test' } });
|
||||
|
||||
console.warn(path);
|
||||
});
|
||||
|
||||
const app = express();
|
||||
|
||||
Reference in New Issue
Block a user