mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-11 04:22:13 +00:00
[now-static-build][frameworks][examples] Fixes examples and adjust frameworks (#3584)
* [examples] Fix ionic-react example * [examples] Fix vue example * [examples] Fix mithril example * [examples] Fix riot example * Fix readmes * [now-static-build] Add Zola * Add tests * [now-build-utils][frameworks] Adjust detect framework * Move zola back * Undo Hugo detection changes * [examples] Fix Vue logo path * [now-static-build] Use package.json script if defined instead of framework command * [now-static-build] Add buildCommand everywhere * Remove devCommand from frameworks.ts * Fix type * Change output directory * [now-static-build] Remove minNodeRange * Remove devCommand
This commit is contained in:
@@ -23,18 +23,22 @@ async function matches(fs: DetectorFilesystem, framework: Framework) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const check = async ({ file, matchContent }: FrameworkDetectionItem) => {
|
||||
if (!file) {
|
||||
const check = async ({ path, matchContent }: FrameworkDetectionItem) => {
|
||||
if (!path) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((await fs.exists(file)) === false) {
|
||||
if ((await fs.hasPath(path)) === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (matchContent) {
|
||||
if ((await fs.isFile(path)) === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const regex = new RegExp(matchContent, 'gm');
|
||||
const content = await fs.readFile(file);
|
||||
const content = await fs.readFile(path);
|
||||
|
||||
if (!regex.test(content.toString())) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user