Skip to content

Commit

Permalink
Update lwpm pkg
Browse files Browse the repository at this point in the history
Signed-off-by: Kang Huaishuai <[email protected]>
  • Loading branch information
khs1994 committed Nov 10, 2023
1 parent f4e878a commit 3d66b0f
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 22 deletions.
12 changes: 7 additions & 5 deletions windows/lnmp-windows-pm-repo/adb/lwpm.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,28 @@
"bug": "",
"github": "",
"releases": "https://developer.android.google.cn/studio/releases/platform-tools",
"url": "https://dl.google.com/android/repository/platform-tools-latest-${env:LWPM_OS}.zip",
"url-mirror": "https://dl.google.com/android/repository/platform-tools_r${VERSION}-windows.zip",
"url": "https://dl.google.com/android/repository/platform-tools-latest-${env:lwpm_os}.zip",
"url-mirror": "https://dl.google.com/android/repository/platform-tools_r${VERSION}-${env:lwpm_os}.zip",
"pre-url": "",
"pre-url-mirror": "",
"command": "adb",
"download-filename": "",
"winget-pkgs": "https://hub.nuaa.cf/microsoft/winget-pkgs/tree/master/manifests/g/Google/PlatformTools",
"scripts": {
"preinstall": [
"# _cleanup \"$unzipDesc\""
"_cleanup \"$unzipDesc\""
],
"install": [
"if($IsWindows){_unzip $filename $env:ProgramData}",
"if(!$IsWindows){_unzip $filename /usr/local/platform-tools}"
"if(!$IsWindows){_unzip $filename $unzipDesc ; sudo cp -r $unzipDesc/platform-tools /usr/local/}",
"if(!$IsWindows){sudo ln -s /usr/local/platform-tools/adb /usr/local/bin/adb}"
],
"postinstall": "",
"preuninstall": "",
"uninstall": [
"if($IsWindows){_cleanup $env:ProgramData\\platform-tools}",
"if(!$IsWindows){_cleanup /usr/local/platform-tools}"
"if(!$IsWindows){sudo rm -rf /usr/local/platform-tools}",
"if(!$IsWindows){sudo rm -rf /usr/local/bin/adb}"
],
"postuninstall": "",
"pruneuninstall": "",
Expand Down
4 changes: 2 additions & 2 deletions windows/lnmp-windows-pm-repo/cfssl/lwpm.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
],
"releases": "https://github.com/cloudflare/cfssl/releases",
"scripts": {
"install": "$url = \"https://${env:GITHUB_MIRROR}/cloudflare/cfssl/releases/download/v${VERSION}\"\n$pkgs='cfssl','cfssl-bundle','cfssl-certinfo','cfssl-newkey','cfssl-scan','cfssljson','mkbundle','multirootca'\nforeach($pkg in $pkgs){\n printInfo Downloading $pkg ...\n\n if($_isWindows){\n $dist=\"C:\\bin\\${pkg}.exe\"\n }else{\n $dist=\"/usr/local/bin/${pkg}\"\n }\n\n if(Test-Path $dist){\n printTips $pkg exists`, skip\n continue;\n }\n\n if($_isWindows){\n curl -fsSL $url/${pkg}_${VERSION}_${env:lwpm_os}_amd64$(if($_isWindows){echo .exe}) -o $dist\n }else{\n sudo curl -fsSL $url/${pkg}_${VERSION}_${env:lwpm_os}_amd64$(if($_isWindows){echo .exe}) -o $dist\n sudo chmod +x $dist\n }\n\n}\n",
"install": "$url = \"https://github.com/cloudflare/cfssl/releases/download/v${VERSION}\"\n$pkgs='cfssl','cfssl-bundle','cfssl-certinfo','cfssl-newkey','cfssl-scan','cfssljson','mkbundle','multirootca'\nforeach($pkg in $pkgs){\n printInfo Downloading $pkg ...\n\n if($_isWindows){\n $dist=\"C:\\bin\\${pkg}.exe\"\n }else{\n $dist=\"/usr/local/bin/${pkg}\"\n }\n\n if(Test-Path $dist){\n printTips $pkg exists`, skip\n continue;\n }\n\n if($_isWindows){\n curl -fsSL $url/${pkg}_${VERSION}_${env:lwpm_os}_${env:lwpm_architecture}$(if($_isWindows){echo .exe}) -o $dist\n }else{\n printInfo \"Download from $url/${pkg}_${VERSION}_${env:lwpm_os}_${env:lwpm_architecture}$(if($_isWindows){echo .exe})\"\n sudo curl -fsSL $url/${pkg}_${VERSION}_${env:lwpm_os}_${env:lwpm_architecture}$(if($_isWindows){echo .exe}) -o $dist\n sudo chmod +x $dist\n }\n\n}\n",
"test": "cfssl version"
},
"version": "1.6.1"
"version": "1.6.4"
}
7 changes: 4 additions & 3 deletions windows/lnmp-windows-pm-repo/cfssl/lwpm.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: cfssl
version: 1.6.1
version: 1.6.4
github: cloudflare/cfssl
releases: https://github.com/cloudflare/cfssl/releases
scripts:
Expand All @@ -21,9 +21,10 @@ scripts:
}

if($_isWindows){
curl -fsSL $url/${pkg}_${VERSION}_${env:lwpm_os}_amd64$(if($_isWindows){echo .exe}) -o $dist
curl -fsSL $url/${pkg}_${VERSION}_${env:lwpm_os}_${env:lwpm_architecture}$(if($_isWindows){echo .exe}) -o $dist
}else{
sudo curl -fsSL $url/${pkg}_${VERSION}_${env:lwpm_os}_amd64$(if($_isWindows){echo .exe}) -o $dist
printInfo "Download from $url/${pkg}_${VERSION}_${env:lwpm_os}_${env:lwpm_architecture}$(if($_isWindows){echo .exe})"
sudo curl -fsSL $url/${pkg}_${VERSION}_${env:lwpm_os}_${env:lwpm_architecture}$(if($_isWindows){echo .exe}) -o $dist
sudo chmod +x $dist
}

Expand Down
4 changes: 2 additions & 2 deletions windows/lnmp-windows-pm-repo/deno/lwpm.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "deno",
"description": "A secure runtime for JavaScript and TypeScript built with V8, Rust, and Tokio",
"version": "1.31.1",
"pre-version": "1.31.1",
"version": "1.38.0",
"pre-version": "1.38.0",
"homepage": "https://deno.land/",
"bug": "https://github.com/denoland/deno/issues",
"github": "denoland/deno",
Expand Down
8 changes: 4 additions & 4 deletions windows/lnmp-windows-pm-repo/python/lwpm.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"${env:ProgramData}\\Python",
"${env:ProgramData}\\Python\\Scripts"
],
"pre-url": "https://www.python.org/ftp/python/${VERSION}/python-${VERSION}-amd64.exe",
"pre-url-mirror": "https://repo.huaweicloud.com/python/${VERSION}/python-${VERSION}-amd64.exe",
"pre-url": "https://www.python.org/ftp/python/${VERSION}/python-${VERSION}-${env:lwpm_architecture}.exe",
"pre-url-mirror": "https://repo.huaweicloud.com/python/${VERSION}/python-${VERSION}-${env:lwpm_architecture}.exe",
"pre-version": "3.11.1",
"releases": "https://www.python.org/downloads/",
"scripts": {
Expand All @@ -21,7 +21,7 @@
"test": "python --version",
"version": "($(python --version) -split \" \")[1]"
},
"url": "https://www.python.org/ftp/python/${VERSION}/python-${VERSION}-amd64.exe",
"url-mirror": "https://repo.huaweicloud.com/python/${VERSION}/python-${VERSION}-amd64.exe",
"url": "https://www.python.org/ftp/python/${VERSION}/python-${VERSION}-${env:lwpm_architecture}.exe",
"url-mirror": "https://repo.huaweicloud.com/python/${VERSION}/python-${VERSION}-${env:lwpm_architecture}.exe",
"version": "3.11.1"
}
8 changes: 4 additions & 4 deletions windows/lnmp-windows-pm-repo/python/lwpm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ homepage: "https://www.python.org/"
bug: ""
github: "python/cpython"
releases: "https://www.python.org/downloads/"
url: "https://www.python.org/ftp/python/${VERSION}/python-${VERSION}-amd64.exe"
url-mirror: "https://repo.huaweicloud.com/python/${VERSION}/python-${VERSION}-amd64.exe"
pre-url: "https://www.python.org/ftp/python/${VERSION}/python-${VERSION}-amd64.exe"
pre-url-mirror: "https://repo.huaweicloud.com/python/${VERSION}/python-${VERSION}-amd64.exe"
url: "https://www.python.org/ftp/python/${VERSION}/python-${VERSION}-${env:lwpm_architecture}.exe"
url-mirror: "https://repo.huaweicloud.com/python/${VERSION}/python-${VERSION}-${env:lwpm_architecture}.exe"
pre-url: "https://www.python.org/ftp/python/${VERSION}/python-${VERSION}-${env:lwpm_architecture}.exe"
pre-url-mirror: "https://repo.huaweicloud.com/python/${VERSION}/python-${VERSION}-${env:lwpm_architecture}.exe"
path:
- ${env:ProgramData}\Python
- ${env:ProgramData}\Python\Scripts
Expand Down
2 changes: 1 addition & 1 deletion windows/lnmp-windows-pm-repo/wechat/lwpm.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
"install": "Start-Process -FilePath $filename -wait",
"uninstall": "& ${env:ProgramFiles(x86)}\\Tencent\\WeChat\\Uninstall.exe",
"version": "echo ${VERSION}",
"test": "& get-command ${env:ProgramFiles(x86)}\\Tencent\\WeChat\\WeChat.exe"
"test": "if($IsWindows){& get-command ${env:ProgramFiles(x86)}\\Tencent\\WeChat\\WeChat.exe}"
}
}
2 changes: 1 addition & 1 deletion windows/lnmp-windows-pm-repo/wechatDevtool/lwpm.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"pre-version": "1.06.2305042",
"homepage": "https://developers.weixin.qq.com/miniprogram/dev/devtools/devtools.html",
"bug": "https://developers.weixin.qq.com/community/develop/question",
"github": "https://github.com/wechat-miniprogram",
"github": "wechat-miniprogram",
"releases": "https://developers.weixin.qq.com/miniprogram/dev/devtools/download.html",
"url": "https://dldir1.qq.com/WechatWebDev/nightly/p-3bd19c2db3a642a0b39af853efaf67f8/0.54.1/wechat_devtools_${VERSION}$(if($IsWindows){echo _win32_x64.exe}else{if(${env:lwpm_architecture} -eq 'amd64'){echo _darwin_x64.dmg}else{echo _darwin_arm64.dmg}})",
"command": "'C:\\Program Files (x86)\\Tencent\\微信web开发者工具\\cli.bat'",
Expand Down
19 changes: 19 additions & 0 deletions windows/lnmp-windows-pm.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ list List available softs
outdated Shows a list of installed packages that have updates available
info Shows information about packages
homepage Opens the package's repository URL or homepage in your browser
github Opens the package's repository URL in your browser
bug Opens the package's bug report page in your browser
releases Opens the package's releases page in your browser
help Print help info
Expand Down Expand Up @@ -644,8 +645,17 @@ function __homepage($soft) {
$lwpm = manifest $soft
if ($lwpm.homepage) {
start-process $lwpm.homepage

return
}

if ($lwpm.github) {
start-process "https://github.com/$($lwpm.github)"
}
}

function __github($soft) {
$lwpm = manifest $soft
if ($lwpm.github) {
start-process "https://github.com/$($lwpm.github)"
}
Expand Down Expand Up @@ -1061,6 +1071,15 @@ if ($args[0] -eq 'homepage') {
_exit
}

if ($args[0] -eq 'github') {
if ($args[1].length -eq 0) {
"Please input soft name"
_exit
}
__github $args[1]
_exit
}

if ($args[0] -eq 'bug') {
if ($args[1].length -eq 0) {
"Please input soft name"
Expand Down

0 comments on commit 3d66b0f

Please sign in to comment.