mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 02:27:29 -05:00 
			
		
		
		
	Merge pull request #4158 from Striffly/features/browsershot-nodepaths
Add ability to use Browsershot with NODE_PATH & NPM_PATH env variables
This commit is contained in:
		
						commit
						6256b197bf
					
				@ -192,6 +192,8 @@ class SetupController extends Controller
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Browsershot::html('PDF GENERATION WORKS! Thank you for using Invoice Ninja!')
 | 
					            Browsershot::html('PDF GENERATION WORKS! Thank you for using Invoice Ninja!')
 | 
				
			||||||
 | 
					                ->setNodeBinary(config('ninja.system.node_path'))
 | 
				
			||||||
 | 
					                ->setNpmBinary(config('ninja.system.npm_path'))
 | 
				
			||||||
                ->noSandbox()
 | 
					                ->noSandbox()
 | 
				
			||||||
                ->savePdf(
 | 
					                ->savePdf(
 | 
				
			||||||
                    public_path('test.pdf')
 | 
					                    public_path('test.pdf')
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										773
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										773
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@ -16,6 +16,7 @@
 | 
				
			|||||||
        "@babel/plugin-proposal-class-properties": "^7.10.4",
 | 
					        "@babel/plugin-proposal-class-properties": "^7.10.4",
 | 
				
			||||||
        "cypress": "^4.12.1",
 | 
					        "cypress": "^4.12.1",
 | 
				
			||||||
        "laravel-mix-purgecss": "^5.0.0",
 | 
					        "laravel-mix-purgecss": "^5.0.0",
 | 
				
			||||||
 | 
					        "puppeteer": "^5.3.1",
 | 
				
			||||||
        "vue-template-compiler": "^2.6.11"
 | 
					        "vue-template-compiler": "^2.6.11"
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "dependencies": {
 | 
					    "dependencies": {
 | 
				
			||||||
@ -27,7 +28,6 @@
 | 
				
			|||||||
        "jsignature": "^2.1.3",
 | 
					        "jsignature": "^2.1.3",
 | 
				
			||||||
        "laravel-mix": "^5.0.7",
 | 
					        "laravel-mix": "^5.0.7",
 | 
				
			||||||
        "lodash": "^4.17.20",
 | 
					        "lodash": "^4.17.20",
 | 
				
			||||||
        "puppeteer": "^1.20.0",
 | 
					 | 
				
			||||||
        "resolve-url-loader": "^3.1.0",
 | 
					        "resolve-url-loader": "^3.1.0",
 | 
				
			||||||
        "sass": "^1.26.10",
 | 
					        "sass": "^1.26.10",
 | 
				
			||||||
        "sass-loader": "^8.0.0",
 | 
					        "sass-loader": "^8.0.0",
 | 
				
			||||||
 | 
				
			|||||||
@ -28,6 +28,8 @@ class PdfGenerationTest extends TestCase
 | 
				
			|||||||
    private function makePdf($header, $footer, $html, $pdf)
 | 
					    private function makePdf($header, $footer, $html, $pdf)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        Browsershot::html($html)
 | 
					        Browsershot::html($html)
 | 
				
			||||||
 | 
					            ->setNodeBinary(config('ninja.system.node_path'))
 | 
				
			||||||
 | 
					            ->setNpmBinary(config('ninja.system.npm_path'))
 | 
				
			||||||
            //->showBrowserHeaderAndFooter()
 | 
					            //->showBrowserHeaderAndFooter()
 | 
				
			||||||
            //->headerHtml($header)
 | 
					            //->headerHtml($header)
 | 
				
			||||||
            //->footerHtml($footer)
 | 
					            //->footerHtml($footer)
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user