Commit c1447b61 authored by Philipp Nowinski's avatar Philipp Nowinski
Browse files

[FEATURE] add upgrade wizards for scss-lint => stylelint

parent 36dfd35b
......@@ -74,6 +74,53 @@ function checkJsHint() {
fs.unlink(process.cwd() + '/../.jshintrc', error => console.log);
console.log(chalk.green('Removed .jshintrc ✓'));
}
checkStyleLint();
});
} else {
checkStyleLint();
}
});
}
function checkStyleLint() {
fs.exists(process.cwd() + '/../.stylelintrc', exists => {
if (!exists) {
console.log('');
inquirer.prompt([
{
type: 'confirm',
name: 'provideStyleLint',
message: 'Looks like you don\'t have a Stylelint configuration file, yet. Do you want to include the sgalinski default configuration?'
}
]).then(answers => {
if (answers.provideStyleLint) {
request('https://gitlab.sgalinski.de/snippets/29/raw').pipe(fs.createWriteStream(process.cwd() + '/../.stylelintrc'));
console.log(chalk.green('Add Stylelint configuration ✓'));
}
checkScssLint();
});
} else {
console.log(chalk.green('Stylelint configuration found ✓'));
checkScssLint();
}
});
}
function checkScssLint() {
fs.exists(process.cwd() + '/../.scss-lint.yml', exists => {
if (exists) {
console.log('');
inquirer.prompt([
{
type: 'confirm',
name: 'removeScssLint',
message: 'The SGC does not use scss-lint anymore. Do you want to remove your .scss-lint.yml file?'
}
]).then(answers => {
if (answers.removeScssLint) {
fs.unlink(process.cwd() + '/../.scss-lint.yml', error => console.log);
console.log(chalk.green('Removed .scss-lint.yml ✓'));
}
});
}
});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment