mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-03-05 19:51:08 +01:00
@@ -18,7 +18,7 @@ var getGlobbedPaths = function(globPatterns, excludes) {
|
||||
// The output array
|
||||
var output = [];
|
||||
|
||||
// If glob pattern is array so we use each pattern in a recursive way, otherwise we use glob
|
||||
// If glob pattern is array so we use each pattern in a recursive way, otherwise we use glob
|
||||
if (_.isArray(globPatterns)) {
|
||||
globPatterns.forEach(function(globPattern) {
|
||||
output = _.union(output, getGlobbedPaths(globPattern, excludes));
|
||||
@@ -27,25 +27,20 @@ var getGlobbedPaths = function(globPatterns, excludes) {
|
||||
if (urlRegex.test(globPatterns)) {
|
||||
output.push(globPatterns);
|
||||
} else {
|
||||
glob(globPatterns, {
|
||||
sync: true
|
||||
}, function(err, files) {
|
||||
if (excludes) {
|
||||
files = files.map(function(file) {
|
||||
if (_.isArray(excludes)) {
|
||||
for (var i in excludes) {
|
||||
file = file.replace(excludes[i], '');
|
||||
}
|
||||
} else {
|
||||
file = file.replace(excludes, '');
|
||||
var files = glob.sync(globPatterns);
|
||||
if (excludes) {
|
||||
files = files.map(function(file) {
|
||||
if (_.isArray(excludes)) {
|
||||
for (var i in excludes) {
|
||||
file = file.replace(excludes[i], '');
|
||||
}
|
||||
|
||||
return file;
|
||||
});
|
||||
}
|
||||
|
||||
output = _.union(output, files);
|
||||
});
|
||||
} else {
|
||||
file = file.replace(excludes, '');
|
||||
}
|
||||
return file;
|
||||
});
|
||||
}
|
||||
output = _.union(output, files);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,26 +51,20 @@ var getGlobbedPaths = function(globPatterns, excludes) {
|
||||
* Validate NODE_ENV existance
|
||||
*/
|
||||
var validateEnvironmentVariable = function() {
|
||||
glob('./config/env/' + process.env.NODE_ENV + '.js', {
|
||||
sync: true
|
||||
}, function(err, environmentFiles) {
|
||||
console.log();
|
||||
|
||||
if (!environmentFiles.length) {
|
||||
if (process.env.NODE_ENV) {
|
||||
console.error(chalk.red('No configuration file found for "' + process.env.NODE_ENV + '" environment using development instead'));
|
||||
} else {
|
||||
console.error(chalk.red('NODE_ENV is not defined! Using default development environment'));
|
||||
}
|
||||
|
||||
process.env.NODE_ENV = 'development';
|
||||
var environmentFiles = glob.sync('./config/env/' + process.env.NODE_ENV + '.js');
|
||||
console.log();
|
||||
if (!environmentFiles.length) {
|
||||
if (process.env.NODE_ENV) {
|
||||
console.error(chalk.red('No configuration file found for "' + process.env.NODE_ENV + '" environment using development instead'));
|
||||
} else {
|
||||
console.log(chalk.bold('Application loaded using the "' + process.env.NODE_ENV + '" environment configuration'));
|
||||
console.error(chalk.red('NODE_ENV is not defined! Using default development environment'));
|
||||
}
|
||||
|
||||
// Reset console color
|
||||
console.log(chalk.white(''));
|
||||
});
|
||||
process.env.NODE_ENV = 'development';
|
||||
} else {
|
||||
console.log(chalk.bold('Application loaded using the "' + process.env.NODE_ENV + '" environment configuration'));
|
||||
}
|
||||
// Reset console color
|
||||
console.log(chalk.white(''));
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
"bower": "~1.3.8",
|
||||
"grunt-cli": "~0.1.13",
|
||||
"chalk": "~0.5.1",
|
||||
"glob": "~4.0.5",
|
||||
"glob": "~5.0.0",
|
||||
"async": "~0.9.0",
|
||||
"nodemailer": "~1.3.0"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user