-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(kkt): Fix --app-src args errors.
- Loading branch information
1 parent
81b99b2
commit d648429
Showing
5 changed files
with
53 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import fs from 'fs'; | ||
import path from 'path'; | ||
import { reactDevUtils } from '../utils/path'; | ||
import { OverridePaths } from './paths'; | ||
|
||
/** | ||
* [create-react-app/react-dev-utils/checkRequiredFiles.js](https://github.com/facebook/create-react-app/blob/0f6fc2bc71d78f0dcae67f3f08ce98a42fc0a57c/packages/react-dev-utils/checkRequiredFiles.js#L14-L30) | ||
*/ | ||
export function checkRequiredFiles(paths: OverridePaths) { | ||
const checkRequiredFilesPath = `${reactDevUtils}/checkRequiredFiles`; | ||
require(checkRequiredFilesPath); | ||
require.cache[require.resolve(checkRequiredFilesPath)].exports = (files: fs.PathLike[]) => { | ||
files = files.map(item => { | ||
if (paths._oldPaths && item === paths._oldPaths.appIndexJs) { | ||
return paths.appIndexJs | ||
} | ||
return item | ||
}); | ||
|
||
let currentFilePath; | ||
try { | ||
files.forEach(filePath => { | ||
currentFilePath = filePath; | ||
fs.accessSync(filePath, fs.constants.F_OK); | ||
}); | ||
return true; | ||
} catch (err) { | ||
var dirName = path.dirname(currentFilePath); | ||
var fileName = path.basename(currentFilePath); | ||
console.log('\x1b[1;31m Could not find a required file. \x1b[0m') | ||
console.log(`\x1b[1;31m Name: \x1b[0m ${fileName}`); | ||
console.log(`\x1b[1;31m Searched in: \x1b[0m \x1b[1;36m${dirName}\x1b[0m`); | ||
return false; | ||
} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters