You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to do a function to upgrade one project, for this I need to create a temporary project first, and then move the content of this project from the temporary folder to the project folder, so I need to create a custom generator call other generators, or call a method to process the template, is there a corresponding way?
like
import { execSync } from 'child_process';
import chalk from 'chalk';
import path from 'path';
import { ActionType, CustomActionFunction, NodePlopAPI } from 'plop';
import { getPackageVersions } from '../utils';
export default function (plop: NodePlopAPI) {
plop.setActionType('migration', async function (answers, config, plop) {
const v = execSync('git status').toString()
if (!v.includes('working tree clean')) {
process.exit()
}
// call ohter generator
return 'success status message';
});
plop.setGenerator('migration', {
description: 'migration',
prompts: [],
actions: [{
type: 'migration'
}]
});
}
The text was updated successfully, but these errors were encountered:
I want to do a function to upgrade one project, for this I need to create a temporary project first, and then move the content of this project from the temporary folder to the project folder, so I need to create a custom generator call other generators, or call a method to process the template, is there a corresponding way?
like
The text was updated successfully, but these errors were encountered: