1
0
mirror of https://github.com/S2-/minifyfromhtml.git synced 2025-08-03 12:20:04 +02:00

do not loop forever reading config file

This commit is contained in:
s2
2018-05-08 20:01:05 +02:00
parent 78e71967de
commit 040e1c6c4f
2 changed files with 2 additions and 2 deletions

View File

@@ -132,7 +132,7 @@ readStdin(function(html) {
try { try {
return JSON.parse(fs.readFileSync(configfilepath + '/.cleancssrc')); return JSON.parse(fs.readFileSync(configfilepath + '/.cleancssrc'));
} catch (e) { } catch (e) {
if (configfilepath != __dirname) { if (configfilepath.length < 4) {
configfilepath = path.resolve(path.normalize(configfilepath + '/../')); configfilepath = path.resolve(path.normalize(configfilepath + '/../'));
return readConfig(configfilepath); return readConfig(configfilepath);
} else { } else {

View File

@@ -1,6 +1,6 @@
{ {
"name": "minifyfromhtml", "name": "minifyfromhtml",
"version": "1.0.0", "version": "1.0.1",
"description": "minify scripts and css starting from an html file", "description": "minify scripts and css starting from an html file",
"main": "minifyfromhtml.js", "main": "minifyfromhtml.js",
"scripts": { "scripts": {