init
This commit is contained in:
		
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
				
			|||||||
 | 
					node_modules
 | 
				
			||||||
							
								
								
									
										17
									
								
								package.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								package.json
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,17 @@
 | 
				
			|||||||
 | 
					{
 | 
				
			||||||
 | 
					  "name": "auto-install-tools",
 | 
				
			||||||
 | 
					  "version": "0.0.1",
 | 
				
			||||||
 | 
					  "description": "",
 | 
				
			||||||
 | 
					  "main": "index.js",
 | 
				
			||||||
 | 
					  "scripts": {
 | 
				
			||||||
 | 
					    "test": "echo \"Error: no test specified\" && exit 1"
 | 
				
			||||||
 | 
					  },
 | 
				
			||||||
 | 
					  "keywords": [],
 | 
				
			||||||
 | 
					  "author": "abearxiong <xiongxiao@xiongxiao.me> (https://www.xiongxiao.me)",
 | 
				
			||||||
 | 
					  "license": "MIT",
 | 
				
			||||||
 | 
					  "packageManager": "pnpm@10.6.2",
 | 
				
			||||||
 | 
					  "type": "module",
 | 
				
			||||||
 | 
					  "devDependencies": {
 | 
				
			||||||
 | 
					    "@types/node": "^22.15.19"
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										29
									
								
								pnpm-lock.yaml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								pnpm-lock.yaml
									
									
									
										generated
									
									
									
										Normal file
									
								
							@@ -0,0 +1,29 @@
 | 
				
			|||||||
 | 
					lockfileVersion: '9.0'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					settings:
 | 
				
			||||||
 | 
					  autoInstallPeers: true
 | 
				
			||||||
 | 
					  excludeLinksFromLockfile: false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					importers:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  .:
 | 
				
			||||||
 | 
					    devDependencies:
 | 
				
			||||||
 | 
					      '@types/node':
 | 
				
			||||||
 | 
					        specifier: ^22.15.19
 | 
				
			||||||
 | 
					        version: 22.15.19
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					packages:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  '@types/node@22.15.19':
 | 
				
			||||||
 | 
					    resolution: {integrity: sha512-3vMNr4TzNQyjHcRZadojpRaD9Ofr6LsonZAoQ+HMUa/9ORTPoxVIw0e0mpqWpdjj8xybyCM+oKOUH2vwFu/oEw==}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  undici-types@6.21.0:
 | 
				
			||||||
 | 
					    resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					snapshots:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  '@types/node@22.15.19':
 | 
				
			||||||
 | 
					    dependencies:
 | 
				
			||||||
 | 
					      undici-types: 6.21.0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  undici-types@6.21.0: {}
 | 
				
			||||||
							
								
								
									
										10
									
								
								src/system/windows/is-admin.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								src/system/windows/is-admin.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,10 @@
 | 
				
			|||||||
 | 
					import { exec } from 'node:child_process';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export function isAdmin() {
 | 
				
			||||||
 | 
					  return new Promise((resolve) => {
 | 
				
			||||||
 | 
					    exec('net session', (error) => {
 | 
				
			||||||
 | 
					      // 如果 `net session` 执行成功(无 error),则是管理员
 | 
				
			||||||
 | 
					      resolve(error === null);
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					  });
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
		Reference in New Issue
	
	Block a user