Skip to content

Commit

Permalink
Fixes migration script to look at files only
Browse files Browse the repository at this point in the history
  • Loading branch information
infomiho committed Feb 26, 2024
1 parent 037f6e9 commit 6a8b612
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"NOTE: Changing the version number on the `main` branch will automatically trigger deployment",
"of the new version of the package on npm!"
],
"version": "1.0.1",
"version": "1.0.2",
"type": "module",
"bin": {
"wasp-migrate": "dist/index.js"
Expand Down
8 changes: 6 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,12 @@ async function sleep(ms: number): Promise<void> {
}

function obtainWaspFileNameInProjectDir(projectDirName: string): string {
const files = fs.readdirSync(projectDirName);
const waspFiles = files.filter((file) => file.endsWith('.wasp'));
const files = fs.readdirSync(projectDirName, {
withFileTypes: true,
});
const waspFiles = files
.filter((file) => file.isFile() && file.name.endsWith(".wasp"))
.map((file) => file.name);
if (waspFiles.length === 0) {
console.error(`Error: No .wasp file found in ${projectDirName}`);
process.exit(1);
Expand Down

0 comments on commit 6a8b612

Please sign in to comment.