mirror of
				https://codeberg.org/yeentown/barkey.git
				synced 2025-10-26 03:04:52 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			27 lines
		
	
	
	
		
			667 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
	
		
			667 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| /*
 | |
|  * SPDX-FileCopyrightText: syuilo and misskey-project
 | |
|  * SPDX-License-Identifier: AGPL-3.0-only
 | |
|  */
 | |
| 
 | |
| const fs = require('fs');
 | |
| const packageJsonPath = __dirname + '/../package.json'
 | |
| 
 | |
| function build() {
 | |
| 	try {
 | |
| 		const json = fs.readFileSync(packageJsonPath, 'utf-8')
 | |
| 		const meta = JSON.parse(json);
 | |
| 		fs.mkdirSync(__dirname + '/../built', { recursive: true });
 | |
| 		fs.writeFileSync(__dirname + '/../built/meta.json', JSON.stringify({ version: meta.version }), 'utf-8');
 | |
| 	} catch (e) {
 | |
| 		console.error(e)
 | |
| 	}
 | |
| }
 | |
| 
 | |
| build();
 | |
| 
 | |
| if (process.argv.includes("--watch")) {
 | |
| 	fs.watch(packageJsonPath, (event, filename) => {
 | |
| 		console.log(`update ${filename} ...`)
 | |
| 		build()
 | |
| 	})
 | |
| }
 |