@@ -1793,13 +1793,16 @@ class HAXCMSClass {
1793
1793
this . superUser = { ...this . user } ;
1794
1794
}
1795
1795
catch ( e ) {
1796
- console . warn ( '***************************************************************' ) ;
1797
- console . warn ( '\nHAXcms USER CONFIGURATION FILE NOT FOUND, creating default user' ) ;
1798
- console . warn ( `${ path . join ( this . configDirectory , ".user" ) } is being created with default credentials` ) ;
1799
- console . warn ( "MAKE SURE YOU EDIT THIS FILE IF PUTTING IN PRODUCTION!!!!!" ) ;
1800
- console . warn ( "username: admin" ) ;
1801
- console . warn ( "password: admin" ) ;
1802
- console . warn ( "\n***************************************************************" ) ;
1796
+ // don't send console warnings if this is CLI
1797
+ if ( ! this . isCLI ( ) ) {
1798
+ console . warn ( '***************************************************************' ) ;
1799
+ console . warn ( '\nHAXcms USER CONFIGURATION FILE NOT FOUND, creating default user' ) ;
1800
+ console . warn ( `${ path . join ( this . configDirectory , ".user" ) } is being created with default credentials` ) ;
1801
+ console . warn ( "MAKE SURE YOU EDIT THIS FILE IF PUTTING IN PRODUCTION!!!!!" ) ;
1802
+ console . warn ( "username: admin" ) ;
1803
+ console . warn ( "password: admin" ) ;
1804
+ console . warn ( "\n***************************************************************" ) ;
1805
+ }
1803
1806
// create a default user
1804
1807
this . superUser = {
1805
1808
name : 'admin' ,
@@ -1811,8 +1814,8 @@ class HAXCMSClass {
1811
1814
} ;
1812
1815
fs . writeFileSync ( path . join ( this . configDirectory , ".user" ) , JSON . stringify ( this . user , null , 2 ) ) ;
1813
1816
}
1814
- // warn if we have default credentials
1815
- if ( this . user . name == 'admin' && this . user . password == 'admin' ) {
1817
+ // warn if we have default credentials unless CLI
1818
+ if ( this . user . name == 'admin' && this . user . password == 'admin' && ! this . isCLI ( ) ) {
1816
1819
console . warn ( '***************************************************************' ) ;
1817
1820
console . warn ( '\nHAXcms USER CONFIGURATION FILE HAS DEFAULT CREDENTIALS, change them!!' ) ;
1818
1821
console . warn ( `\n${ path . join ( this . configDirectory , ".user" ) } ` ) ;
0 commit comments