| 
									
										
										
										
											2019-07-30 09:35:42 +02:00
										 |  |  | 'use strict'; | 
					
						
							| 
									
										
										
										
											2017-12-04 18:16:14 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | // https://github.com/Homebrew/homebrew-core/blob/master/CONTRIBUTING.md
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-19 22:51:18 +01:00
										 |  |  | const rootDir = `${__dirname}/..`; | 
					
						
							| 
									
										
										
										
											2018-03-09 20:59:12 +00:00
										 |  |  | const { execCommand, downloadFile, fileSha256, unlinkForce } = require('./tool-utils.js'); | 
					
						
							| 
									
										
										
										
											2017-12-04 18:16:14 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | async function main() { | 
					
						
							| 
									
										
										
										
											2021-12-20 16:08:43 +01:00
										 |  |  | 	const url = await execCommand('yarn view joplin dist.tarball'); | 
					
						
							| 
									
										
										
										
											2019-09-19 22:51:18 +01:00
										 |  |  | 	const targetPath = `${rootDir}/latest-cli.tar.gz`; | 
					
						
							| 
									
										
										
										
											2017-12-04 18:16:14 +00:00
										 |  |  | 	await unlinkForce(targetPath); | 
					
						
							|  |  |  | 	await downloadFile(url, targetPath); | 
					
						
							|  |  |  | 	const sha256 = await fileSha256(targetPath); | 
					
						
							|  |  |  | 	await unlinkForce(targetPath); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-19 22:51:18 +01:00
										 |  |  | 	console.info(`URL = ${url}`); | 
					
						
							|  |  |  | 	console.info(`SHA256 = ${sha256}`); | 
					
						
							| 
									
										
										
										
											2018-03-09 20:59:12 +00:00
										 |  |  | 	console.info(''); | 
					
						
							| 
									
										
										
										
											2019-09-19 22:51:18 +01:00
										 |  |  | 	console.info(`brew update && brew bump-formula-pr --strict joplin --url=${url} --sha256=${sha256}`); | 
					
						
							| 
									
										
										
										
											2017-12-04 18:16:14 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-03-09 20:59:12 +00:00
										 |  |  | main().catch((error) => { | 
					
						
							|  |  |  | 	console.error('Fatal error'); | 
					
						
							| 
									
										
										
										
											2017-12-04 18:16:14 +00:00
										 |  |  | 	console.error(error); | 
					
						
							| 
									
										
										
										
											2019-07-30 09:35:42 +02:00
										 |  |  | }); |