3
3
const options = require ( './options' )
4
4
const fs = require ( 'fs' )
5
5
const extend = require ( 'extend' )
6
- const colors = require ( 'colors/safe ' )
6
+ const { cyan , red , bold } = require ( 'colorette ' )
7
7
8
8
module . exports = function ( program , server ) {
9
9
const start = program
@@ -29,7 +29,7 @@ module.exports = function (program, server) {
29
29
fs . readFile ( configFile , ( err , file ) => {
30
30
// No file exists, not a problem
31
31
if ( err ) {
32
- console . log ( colors . cyan . bold ( 'TIP' ) , 'create a config.json: `$ solid init`' )
32
+ console . log ( cyan ( bold ( 'TIP' ) ) , 'create a config.json: `$ solid init`' )
33
33
} else {
34
34
// Use flags with priority over config file
35
35
const config = JSON . parse ( file )
@@ -123,17 +123,17 @@ function bin (argv, server) {
123
123
} catch ( e ) {
124
124
if ( e . code === 'EACCES' ) {
125
125
if ( e . syscall === 'mkdir' ) {
126
- console . log ( colors . red . bold ( 'ERROR' ) , `You need permissions to create '${ e . path } ' folder` )
126
+ console . log ( red ( bold ( 'ERROR' ) ) , `You need permissions to create '${ e . path } ' folder` )
127
127
} else {
128
- console . log ( colors . red . bold ( 'ERROR' ) , 'You need root privileges to start on this port' )
128
+ console . log ( red ( bold ( 'ERROR' ) ) , 'You need root privileges to start on this port' )
129
129
}
130
130
return 1
131
131
}
132
132
if ( e . code === 'EADDRINUSE' ) {
133
- console . log ( colors . red . bold ( 'ERROR' ) , 'The port ' + argv . port + ' is already in use' )
133
+ console . log ( red ( bold ( 'ERROR' ) ) , 'The port ' + argv . port + ' is already in use' )
134
134
return 1
135
135
}
136
- console . log ( colors . red . bold ( 'ERROR' ) , e . message )
136
+ console . log ( red ( bold ( 'ERROR' ) ) , e . message )
137
137
return 1
138
138
}
139
139
app . listen ( argv . port , function ( ) {
0 commit comments