Skip to content

Commit

Permalink
fix: unit test error
Browse files Browse the repository at this point in the history
  • Loading branch information
RulerChen committed Jun 17, 2024
1 parent 2b31650 commit aaea3f1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gen-express-cli",
"version": "1.2.0",
"version": "1.2.1",
"description": "A simple express cli to generate express app simply by running a command",
"main": "index.js",
"type": "module",
Expand Down
4 changes: 2 additions & 2 deletions packages/scripts/createUnitTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ export async function createUnitTest(projectName, template, unitTest, alias) {
if (unitTest === 'none') return;

try {
if (alias) unitTest += '-alias';
if (alias) template += '-alias';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const SOURCE_PATH = path.resolve(__dirname, `../templates/unit/${template}`);
const TARGET_PATH = path.resolve(process.cwd(), projectName);

await fsPromises.cp(SOURCE_PATH, TARGET_PATH, { recursive: true });
await fsPromises.cp(SOURCE_PATH, TARGET_PATH, { recursive: true, force: true });
} catch (error) {
throw error;
}
Expand Down

0 comments on commit aaea3f1

Please sign in to comment.