/**
 * Copyright (c) 2014-present, San Wei Ju Yuan Tech Ltd. <https://www.3vjuyuan.com>
 * All rights reserved.
 *
 * This file is part of node-dev-tools, licensed under the MIT license (MIT) found
 * in the LICENSE file in the root directory of this source tree.
 *
 * For more details:
 * https://www.3vjuyuan.com/licenses/mit.html
 *
 * @author Team Fancy <fancy@3vjuyuan.com>
 * @author Team Delta <delta@3vjuyuan.com>
 */

'use strict';

import fs from 'fs';
import yaml from 'js-yaml';
import gulpRequireTasks from 'gulp-require-tasks';
import merge from './scripts/merge';
import empty from './scripts/empty';

process.trimPath = function (input) {
    return 'string' === typeof input ? input.replace(/^\/+|\/+$/g, '') : '';
};

process.getObjectType = function (obj) {
    return ({}).toString.call(obj).slice(8, -1).toLowerCase();
};

let currentPath = process.cwd() + '/',
    projectPath = process.env.PWD + '/' + (empty(process.env.npm_package_project_path) ? '' : process.trimPath(process.env.npm_package_project_path)),
    configuration = merge(
        yaml.load(fs.readFileSync(currentPath + 'default.yml', 'utf8')),
        fs.existsSync(projectPath + 'project.yml') ? yaml.load(fs.readFileSync(projectPath + 'project.yml', 'utf8')) : {}
    ),
    lint;

if (!Array.isArray(configuration.tasks.path)) {
    console.error("\x1b[31m", '\nThe default tasks configuration is lost. The path must be an array.\nPlease Check you configuration file in "UserProject/config.yml".');
    process.exit();
}

if (empty(lint = configuration.styles.lint) || process.getObjectType(lint) !== 'object') {
    lint = {configFile: currentPath + '.sass-lint.yml'};
} else if (empty(lint.configFile)) {
    lint.configFile = currentPath + '.sass-lint.yml';
}

if (empty(lint = configuration.script.lint)) {
    lint = {path: currentPath + '.eslintrc.yml'};
}

process.chdir(projectPath);

for (let i in configuration.tasks.path) {
    gulpRequireTasks({
        path: currentPath + configuration.tasks.path[i],
        arguments: [configuration]
    });
}
@@ -916,14 +916,8 @@
 WD +
- '/' +
  (em
@@ -965,11 +965,18 @@
  ? '
+/
 ' :
+ '/' +
  pro
@@ -1026,16 +1026,22 @@
 ct_path)
+ + '/'
 ),%0A    c
@@ -1272,16 +1272,39 @@
     lint
+,%0A    lintFilePath = ''
 ;%0A%0Aif (!
@@ -1700,33 +1700,231 @@
 e if
- (empty(lint.configFile))
+(%0A    fs.existsSync(lintFilePath = projectPath + process.trimPath(lint.configFile)) %7C%7C%0A    fs.existsSync(lintFilePath = process.env.PWD + '/' + process.trimPath(lint.configFile)))%7B%0A    lint.configFile = lintFilePath;%0A%7D else
  %7B%0A 

Add sass lint file check