Skip to content

Commit 3bdab38

Browse files
committed
Replaced unsupported dependency (find)
1 parent 336e7ef commit 3bdab38

3 files changed

Lines changed: 3 additions & 18 deletions

File tree

package-lock.json

Lines changed: 0 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
"dependencies": {
3131
"change-case": "^4.1.2",
3232
"commander": "^10.0.1",
33-
"find": "^0.3.0",
3433
"node-fetch": "^2.7.0",
3534
"template-file": "^6.0.1"
3635
},

src/generator.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ export async function createFile(name: string, outPath: string, basePath: string
101101
* Return configured application prefix.
102102
*/
103103
function getAppPrefix(basePath: string): string | void {
104-
const files = require('find').fileSync('config.json', basePath);
104+
const config = `${basePath}/config.json`;
105105

106-
if (files) {
107-
return JSON.parse(fs.readFileSync(files[0], 'utf8')).router.prefix;
106+
if (fs.existsSync(config)) {
107+
return JSON.parse(fs.readFileSync(config, 'utf8')).router.prefix;
108108
}
109109

110110
throw new Error('Failed to load application config');

0 commit comments

Comments
 (0)