|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
856 bytes
|
| Line | |
|---|
| 1 | /**
|
|---|
| 2 | * Copyright (c) 2015-present, Facebook, Inc.
|
|---|
| 3 | *
|
|---|
| 4 | * This source code is licensed under the MIT license found in the
|
|---|
| 5 | * LICENSE file in the root directory of this source tree.
|
|---|
| 6 | */
|
|---|
| 7 |
|
|---|
| 8 | 'use strict';
|
|---|
| 9 |
|
|---|
| 10 | var fs = require('fs');
|
|---|
| 11 | var path = require('path');
|
|---|
| 12 | var chalk = require('chalk');
|
|---|
| 13 |
|
|---|
| 14 | function checkRequiredFiles(files) {
|
|---|
| 15 | var currentFilePath;
|
|---|
| 16 | try {
|
|---|
| 17 | files.forEach(filePath => {
|
|---|
| 18 | currentFilePath = filePath;
|
|---|
| 19 | fs.accessSync(filePath, fs.F_OK);
|
|---|
| 20 | });
|
|---|
| 21 | return true;
|
|---|
| 22 | } catch (err) {
|
|---|
| 23 | var dirName = path.dirname(currentFilePath);
|
|---|
| 24 | var fileName = path.basename(currentFilePath);
|
|---|
| 25 | console.log(chalk.red('Could not find a required file.'));
|
|---|
| 26 | console.log(chalk.red(' Name: ') + chalk.cyan(fileName));
|
|---|
| 27 | console.log(chalk.red(' Searched in: ') + chalk.cyan(dirName));
|
|---|
| 28 | return false;
|
|---|
| 29 | }
|
|---|
| 30 | }
|
|---|
| 31 |
|
|---|
| 32 | module.exports = checkRequiredFiles;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.