mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-13 19:45:26 +00:00
replace chalk with clorox
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import * as fs from 'fs';
|
||||
import chalk from 'chalk';
|
||||
import * as clorox from 'clorox';
|
||||
|
||||
export default async function upgrade() {
|
||||
const upgraded = [
|
||||
@@ -27,10 +27,10 @@ async function upgrade_sapper_main() {
|
||||
|
||||
if (/\%sapper\.main\%/.test(template)) {
|
||||
if (!pattern.test(template)) {
|
||||
console.log(chalk.red(`Could not replace %sapper.main% in ${file}`));
|
||||
console.log(clorox.red(`Could not replace %sapper.main% in ${file}`));
|
||||
} else {
|
||||
write(file, template.replace(pattern, `%sapper.scripts%`));
|
||||
console.log(chalk.green(`Replaced %sapper.main% in ${file}`));
|
||||
console.log(clorox.green(`Replaced %sapper.main% in ${file}`));
|
||||
replaced = true;
|
||||
}
|
||||
}
|
||||
@@ -50,4 +50,4 @@ function read(file: string) {
|
||||
|
||||
function write(file: string, data: string) {
|
||||
fs.writeFileSync(file, data);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user