From 5e5ad0d793cdb69b714badcbc8ae6fd74dc9cbd0 Mon Sep 17 00:00:00 2001 From: lihan Date: Thu, 21 Dec 2023 19:55:50 +0800 Subject: [PATCH] chore: remove useless file. --- install.ps1 | 39 --------------------- script/java.lua | 38 -------------------- script/node.lua | 93 ------------------------------------------------- 3 files changed, 170 deletions(-) delete mode 100644 install.ps1 delete mode 100644 script/java.lua delete mode 100644 script/node.lua diff --git a/install.ps1 b/install.ps1 deleted file mode 100644 index 20c3b4ab..00000000 --- a/install.ps1 +++ /dev/null @@ -1,39 +0,0 @@ -# install.ps1 -$version = Invoke-RestMethod -Uri "https://api.github.com/repos/aooohan/version-fox/releases/latest" | Select-Object -ExpandProperty tag_name -$osType = "windows" - -# 检测操作系统架构 -if ([IntPtr]::Size -eq 8) { - $archType = "amd64" -} else { - $archType = "386" -} - -$fileName = "version-fox_${version}_${osType}_${archType}.zip" -$url = "https://github.com/aooohan/version-fox/releases/download/$version/$fileName" - -Write-Host "Downloading vfox $version ..." -try { - Invoke-WebRequest -Uri $url -OutFile $fileName -} catch { - Write-Host "Failed to download vfox. Please check your network connection and try again." - exit 1 -} -Write-Host "Extracting vfox ..." -Expand-Archive -Path $fileName -DestinationPath . - -$destDir = "C:\Program Files\version-fox" -if (!(Test-Path -Path $destDir)) { - New-Item -ItemType Directory -Path $destDir | Out-Null -} - -Write-Host "Moving vfox to $destDir ..." -Move-Item -Path .\vfox -Destination $destDir - -$envPath = [Environment]::GetEnvironmentVariable("Path", "Machine") -if (!$envPath.Contains($destDir)) { - [Environment]::SetEnvironmentVariable("Path", $envPath + ";$destDir", "Machine") -} - -Remove-Item $fileName -Write-Host "vfox installed successfully!" \ No newline at end of file diff --git a/script/java.lua b/script/java.lua deleted file mode 100644 index 790b0ccd..00000000 --- a/script/java.lua +++ /dev/null @@ -1,38 +0,0 @@ ---- Default global variable ---- OS_TYPE: windows, linux, darwin ---- ARCH_TYPE: 386, amd64, arm, arm64 ... - -OS_TYPE = "" -ARCH_TYPE = "" - -SearchUrl = "https://api.adoptium.net/v3/assets/latest/%s/hotspot?os=%s&architecture=%s" -AvailableVersionsUrl = "https://api.adoptium.net/v3/info/available_releases" - - - -PLUGIN = { - name = "adoptium-jdk", - author = "Han Li", - version = "0.0.1", - updateUrl = "", -} - -function PLUGIN:PreInstall(ctx) -end - -function PLUGIN:PostInstall(ctx) -end - -function PLUGIN:Available(ctx) - return {} -end - -function PLUGIN:EnvKeys(ctx) - version_path = ctx.version_path - return { - { - key = "PATH", - value = version_path .. "/bin" - } - } -end diff --git a/script/node.lua b/script/node.lua deleted file mode 100644 index 78115bf3..00000000 --- a/script/node.lua +++ /dev/null @@ -1,93 +0,0 @@ ---- Default global variable ---- OS_TYPE: windows, linux, darwin ---- ARCH_TYPE: 386, amd64, arm, arm64 ... -local http = require("http") -local json = require("json") - -OS_TYPE = "" -ARCH_TYPE = "" - -nodeDownloadUrl = "https://nodejs.org/dist/v%s/node-v%s-%s-%s%s" -npmDownloadUrl = "https://github.com/npm/cli/archive/v%s.%s" - -VersionSourceUrl = "https://nodejs.org/dist/index.json" - -PLUGIN = { - name = "node", - author = "Han Li", - version = "0.0.1", - updateUrl = "https://raw.githubusercontent.com/aooohan/ktorm-generator/main/build.gradle.lua", -} - -function PLUGIN:PreInstall(ctx) - local version = ctx.version - - local arch_type = ARCH_TYPE - local ext = ".tar.gz" - local osType = OS_TYPE - if arch_type == "amd64" then - arch_type = "x64" - end - if OS_TYPE == "windows" then - ext = ".zip" - osType = "win" - end - local node_url = string.format(nodeDownloadUrl, version, version, osType, arch_type, ext) - --local npm_url = string.format(npmDownloadUrl, version, ext) - return { - version = version, - url = node_url, - } -end - -function PLUGIN:Available(ctx) - local resp, err = http.get({ - url = VersionSourceUrl - }) - if err ~= nil or resp.status_code ~= 200 then - return {} - end - local body = json.decode(resp.body) - local result = {} - for _, v in ipairs(body) do - table.insert(result, { - version = string.gsub(v.version, "^v", ""), - note = v.lts and "LTS" or "", - additional = { - { - name = "npm", - version = v.npm, - } - } - }) - end - return result -end - ---- Expansion point -function PLUGIN:PostInstall(ctx) - local rootPath = ctx.rootPath - local sdkInfo = ctx.sdkInfo['node'] - local path = sdkInfo.path - local version = sdkInfo.version - local name = sdkInfo.name -end - -function PLUGIN:EnvKeys(ctx) - local version_path = ctx.path - if OS_TYPE == "windows" then - return { - { - key = "PATH", - value = version_path - }, - } - else - return { - { - key = "PATH", - value = version_path .. "/bin" - }, - } - end -end