Lines Matching refs:filePath
227 const filePath: string = path.join(dir, element); constant
228 const status: fs.Stats = fs.statSync(filePath);
230 readFile(filePath, utFiles);
232 utFiles.push(filePath);
305 export function writeFileSync(filePath: string, content: string): void {
306 if (!fs.existsSync(filePath)) {
307 const parent: string = path.join(filePath, '..');
312 fs.writeFileSync(filePath, content);
315 export function genTemporaryPath(filePath: string, projectPath: string, buildPath: string,
317 filePath = toUnixPath(filePath).replace(/\.[cm]js$/, EXTNAME_JS);
322 const relativeFilePath: string = filePath.replace(projectRootPath, '');
327 if (isPackageModulesFile(filePath, projectConfig)) {
331 if (filePath.indexOf(fakePkgModulesPath) === -1) {
333 const tempFilePath: string = filePath.replace(hapPath, '');
337 output = filePath.replace(fakePkgModulesPath,
343 if (filePath.indexOf(projectPath) !== -1) {
344 const relativeFilePath: string = filePath.replace(projectPath, '');
352 export function isPackageModulesFile(filePath: string, projectConfig: any): boolean {
353 filePath = toUnixPath(filePath);
355 const tempFilePath: string = filePath.replace(hapPath, '');
359 if (filePath.indexOf(fakePkgModulesPath) !== -1) {
366 if (filePath.indexOf(fakeModulePkgModulesPath) !== -1) {
457 export function validateFilePathLength(filePath: string, logger: any): boolean {
462 } else if (filePath.length > 0 && filePath.length <= maxFilePathLength()) {
464 } else if (filePath.length > maxFilePathLength()) {
465 …logger.error(red, `The length of ${filePath} exceeds the limitation of current platform, which is …
478 filePaths.forEach((filePath) => {
479 if (!validateFilePathLength(filePath, logger)) {
486 export function unlinkSync(filePath: string): void {
487 if (fs.existsSync(filePath)) {
488 fs.unlinkSync(filePath);
492 export function getExtensionIfUnfullySpecifiedFilepath(filePath: string): string {
493 if (fs.existsSync(filePath) && fs.statSync(filePath).isFile()) {
498 if (fs.existsSync(filePath + '.ts') && fs.statSync(filePath + '.ts').isFile()) {
500 } else if (fs.existsSync(filePath + '.d.ts') && fs.statSync(filePath + '.d.ts').isFile()) {
502 } else if (fs.existsSync(filePath + '.d.ets') && fs.statSync(filePath + '.d.ets').isFile()) {
504 } else if (fs.existsSync(filePath + '.js') && fs.statSync(filePath + '.js').isFile()) {
506 } else if (fs.existsSync(filePath + '.json') && fs.statSync(filePath + '.json').isFile()) {