mirror of
				https://gitea.invidious.io/iv-org/videojs-quality-selector.git
				synced 2024-08-15 00:43:13 +00:00 
			
		
		
		
	build: prevent error thrown when installed from a git URL
This commit is contained in:
		
							parent
							
								
									c416a312ab
								
							
						
					
					
						commit
						738a1b2234
					
				
					 1 changed files with 13 additions and 3 deletions
				
			
		
							
								
								
									
										16
									
								
								Gruntfile.js
									
										
									
									
									
								
							
							
						
						
									
										16
									
								
								Gruntfile.js
									
										
									
									
									
								
							|  | @ -10,7 +10,17 @@ const sass = require('sass'); | |||
| module.exports = function(grunt) { | ||||
| 
 | ||||
|    var DEBUG = !!grunt.option('debug'), | ||||
|        config; | ||||
|        pkgJSON = grunt.file.readJSON('package.json'), | ||||
|        config, versionInfo; | ||||
| 
 | ||||
|    try { | ||||
|       versionInfo = getCodeVersion.both(); | ||||
|    } catch(e) { | ||||
|       // When this package is installed as a git URL, getCodeVersion throws an error and
 | ||||
|       // is not able to find the git version for this package. So, we fall back to using
 | ||||
|       // the version number from package.json
 | ||||
|       versionInfo = pkgJSON.version; | ||||
|    } | ||||
| 
 | ||||
|    config = { | ||||
|       js: { | ||||
|  | @ -41,8 +51,8 @@ module.exports = function(grunt) { | |||
| 
 | ||||
|    grunt.initConfig({ | ||||
| 
 | ||||
|       pkg: grunt.file.readJSON('package.json'), | ||||
|       versionInfo: getCodeVersion.both(), | ||||
|       pkg: pkgJSON, | ||||
|       versionInfo: versionInfo, | ||||
|       config: config, | ||||
| 
 | ||||
|       browserify: { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue