mirror of
				https://github.com/siyuan-note/plugin-sample-vite-svelte.git
				synced 2025-11-03 21:30:51 +00:00 
			
		
		
		
	dev
This commit is contained in:
		
							parent
							
								
									aa19c76235
								
							
						
					
					
						commit
						831ba76c7c
					
				
					 1 changed files with 21 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -11,7 +11,28 @@ const targetDir = '';
 | 
			
		|||
//********************************************************************************************
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
async function getSiYuanDir() {
 | 
			
		||||
    let url = 'http://127.0.0.1:6806/api/system/getConf';
 | 
			
		||||
    let header = {
 | 
			
		||||
        // "Authorization": `Token ${token}`,
 | 
			
		||||
        "Content-Type": "application/json",
 | 
			
		||||
    }
 | 
			
		||||
    try {
 | 
			
		||||
        let conf = await fetch(url, {
 | 
			
		||||
            method: 'POST',
 | 
			
		||||
            headers: header
 | 
			
		||||
        });
 | 
			
		||||
        console.log(conf);
 | 
			
		||||
    } catch (e) {
 | 
			
		||||
        console.log('Failed! Please make sure SiYuan is running');
 | 
			
		||||
        process.exit(1);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
if (targetDir === '') {
 | 
			
		||||
    await getSiYuanDir();
 | 
			
		||||
    process.exit(0);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//Check
 | 
			
		||||
if (!fs.existsSync(targetDir)) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue