Skip to content

Commit 5b371fb

Browse files
committed
更新说明
1 parent 3df4cbe commit 5b371fb

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,19 @@
77
* MSG - 生成多语言资源代码,支持 Android/IOS/JSON/Java/.NET
88

99
## 安装
10+
Mac/Linux 用户
1011
```sh
12+
#!/usr/bin/env sh
1113
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/excel-code-generator/code-generator/master/install.sh)"
1214
```
1315
将以上命令粘贴至终端。
1416

15-
> Windows 用户请先安装 [Bash Shell](https://git-scm.com/download/win)
17+
Windows 用户
18+
```ps1
19+
# PowerShell
20+
iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/excel-code-generator/code-generator/master/install.ps1'))
21+
```
22+
将以上命令粘贴至PowerShell。
1623

1724
## 参数说明
1825
```

install.ps1

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,25 @@ $repoPath="https://github.com/$repo"
1111
$rawPath="https://raw.githubusercontent.com/$repo"
1212

1313
# latest version
14-
echo "Get the latest version"
14+
Write-Output "Get the latest version"
1515
$releasesUri = "https://api.github.com/repos/$repo/releases/latest"
1616
$tag = (Invoke-WebRequest $releasesUri | ConvertFrom-Json)[0].tag_name
17-
echo "Latest version: $tag"
17+
Write-Output "Latest version: $tag"
1818

1919
# download
20-
echo "Downloading..."
20+
Write-Output "Downloading..."
2121
function download_file($name, $path) {
22-
echo "Download file $path "
22+
Write-Output "Download file $path "
2323
if ( Test-Path "$env:TEMP\$name" ) {
2424
del "$env:TEMP\$name"
2525
}
2626

2727
Invoke-WebRequest $path -Out "$env:TEMP\$name"
2828
}
29-
download_file cg "$rawPath/$tag/LICENSE"
29+
download_file cg "$rawPath/$tag/cg"
3030
download_file cg.bat "$rawPath/$tag/cg.bat"
3131
download_file cg.jar "$repoPath/releases/download/$tag/cg.jar"
32-
echo "Download success."
32+
Write-Output "Download success."
3333

3434
# move file
3535
$cgPath = "$env:APPDATA\cg\bin"
@@ -43,7 +43,7 @@ mv "$env:TEMP\cg.bat" $cgPath
4343
mv "$env:TEMP\cg.jar" $cgPath
4444

4545
# set environment
46-
echo "setting environment."
46+
Write-Output "setting environment."
4747
$alreadyAdded = $False
4848
$path = [environment]::GetEnvironmentvariable("PATH", "User")
4949
$path.Split(";") | ForEach-Object -Process {if ($_ -eq $cgPath) { $alreadyAdded = $True }}
@@ -53,5 +53,5 @@ if (! $alreadyAdded) {
5353
$path = [environment]::SetEnvironmentvariable("PATH", $path, "User")
5454
}
5555

56-
echo "Install success!"
56+
Write-Output "Install success!"
5757
cg -v

0 commit comments

Comments
 (0)