@@ -43,23 +43,23 @@ const _wpThemeVersion = packageJson.version;
4343const _createReactAppVersion = _wpThemeVersion . split ( "-wp." ) [ 0 ] ;
4444
4545// Check these!!!!
46- const _reactScriptsWpThemeVersion = "^3.4.0-wp.1 " ;
47- const _getScriptsPath = function ( ) {
46+ const _reactScriptsWpThemeVersion = "^3.4.0-wp.2 " ;
47+ const _getScriptsPath = function ( ) {
4848return scriptsFromNpm ( ) ;
4949} ;
5050
51- const scriptsFromNpm = function ( ) {
51+ const scriptsFromNpm = function ( ) {
5252//console.log("SCRIPTS FROM NPM");
5353return {
54- path :`@devloco/react-scripts-wptheme@${ _reactScriptsWpThemeVersion } `
54+ path :`@devloco/react-scripts-wptheme@${ _reactScriptsWpThemeVersion } ` ,
5555} ;
5656} ;
5757
58- const scriptsFromGit = function ( ) {
58+ const scriptsFromGit = function ( ) {
5959console . log ( "SCRIPTS FROM GIT" ) ;
6060const deleteFolderRecursive = ( path ) => {
6161if ( fs . existsSync ( path ) ) {
62- fs . readdirSync ( path ) . forEach ( function ( file ) {
62+ fs . readdirSync ( path ) . forEach ( function ( file ) {
6363let curPath = path + "/" + file ;
6464if ( fs . statSync ( curPath ) . isDirectory ( ) ) {
6565// recurse
@@ -84,9 +84,9 @@ const scriptsFromGit = function() {
8484let scriptsPath = "file:" + path . join ( tempPath , "create-react-app" , "packages" , "react-scripts" ) ;
8585return {
8686path :scriptsPath ,
87- callback :function ( ) {
87+ callback :function ( ) {
8888deleteFolderRecursive ( tempPath ) ;
89- }
89+ } ,
9090} ;
9191} ;
9292
@@ -122,11 +122,11 @@ if (program.info) {
122122Binaries :[ "Node" , "npm" , "Yarn" ] ,
123123Browsers :[ "Chrome" , "Edge" , "Internet Explorer" , "Firefox" , "Safari" ] ,
124124npmPackages :[ "react" , "react-dom" , "react-scripts" ] ,
125- npmGlobalPackages :[ "create-react-app" ]
125+ npmGlobalPackages :[ "create-react-app" ] ,
126126} ,
127127{
128128duplicates :true ,
129- showNotFound :true
129+ showNotFound :true ,
130130}
131131)
132132. then ( console . log ) ;
@@ -199,7 +199,7 @@ function createWpTheme(root, appName, version, verbose, originalDirectory, templ
199199. then ( ( packageName ) =>
200200checkIfOnline ( useYarn ) . then ( ( isOnline ) => ( {
201201isOnline :isOnline ,
202- packageName :packageName
202+ packageName :packageName ,
203203} ) )
204204)
205205. then ( ( info ) => {
@@ -241,14 +241,14 @@ function createReactApp(createWpThemeReactRoot, appName, version, verbose, origi
241241args . push ( scriptsPath . path ) ;
242242
243243const child = spawn ( command , args , { stdio :"inherit" } )
244- . on ( "error" , function ( err ) {
244+ . on ( "error" , function ( err ) {
245245console . log ( `createReactWpTheme.js ERROR for command:${ command } ${ args . join ( " " ) } ` ) ;
246246throw err ;
247247} )
248248. on ( "close" , ( code ) => {
249249if ( code !== 0 ) {
250250reject ( {
251- command :`${ command } ${ args . join ( " " ) } `
251+ command :`${ command } ${ args . join ( " " ) } ` ,
252252} ) ;
253253
254254return ;
@@ -288,9 +288,7 @@ function getProxy() {
288288} else {
289289try {
290290// Trying to read https-proxy from .npmrc
291- let httpsProxy = execSync ( "npm config get https-proxy" )
292- . toString ( )
293- . trim ( ) ;
291+ let httpsProxy = execSync ( "npm config get https-proxy" ) . toString ( ) . trim ( ) ;
294292return httpsProxy !== "null" ?httpsProxy :undefined ;
295293} catch ( e ) {
296294return ;