//runNPM - run npm install if not done already or foced.
run npm install if not done already or foced.
// runNPM - run npm install if not done already or foced .
func (gbw *BrowserWindow) runNPM(forceinstall bool) (err error) {
	defer errz.Recover(&err)
	nodeModules := filepath.Join(gbw.AppDirectory, "node_modules/")
	forceinstall = !file.Exists(nodeModules)
	if forceinstall {
		logger.Debug().Msgf("Installing npm packages...")
		cmd := exec.Command("npm", "install")
		cmd.Stdout = os.Stdout
		cmd.Stderr = os.Stderr
		cmd.Dir = gbw.AppDirectory
		err = cmd.Start()
		errz.Fatal(err)
		logger.Debug().Msgf("Waiting for batch")
		err = cmd.Wait()
		errz.Fatal(err)
		logger.Debug().Msgf("Batch done")
	}
	return err
}
func ( gbw * BrowserWindow ) runNPM ( forceinstall bool ) ( err error ) { defer errz . Recover ( & err ) nodeModules := filepath . Join ( gbw . AppDirectory , " " ) forceinstall = ! file . Exists ( nodeModules ) if forceinstall { logger . Debug ( ) . Msgf ( " " ) cmd := exec . Command ( " " , " " ) cmd . Stdout = os . Stdout cmd . Stderr = os . Stderr cmd . Dir = gbw . AppDirectory err = cmd . Start ( ) errz . Fatal ( err ) logger . Debug ( ) . Msgf ( " " ) err = cmd . Wait ( ) errz . Fatal ( err ) logger . Debug ( ) . Msgf ( " " ) } return err }
run npm install if not done already or foced.
run npm install if not done already or foced .