mirror of
				https://github.com/softprops/action-gh-release.git
				synced 2025-11-03 21:29:24 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			13 lines
		
	
	
		
			334 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			13 lines
		
	
	
		
			334 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
import osName from "os-name";
 | 
						|
export function getUserAgent() {
 | 
						|
    try {
 | 
						|
        return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
 | 
						|
    }
 | 
						|
    catch (error) {
 | 
						|
        if (/wmic os get Caption/.test(error.message)) {
 | 
						|
            return "Windows <version undetectable>";
 | 
						|
        }
 | 
						|
        throw error;
 | 
						|
    }
 | 
						|
}
 |