Skip to content

Commit fbd6eff

Browse files
Merge pull request #423 from appwrite/fix-windows-cli-command
Fix: Powershell install
2 parents b95e2ee + 5e2446b commit fbd6eff

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

example.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ function getSSLPage($url) {
169169

170170
$sdk
171171
->setName('NAME')
172-
->setVersion('0.0.19')
172+
->setVersion('0.16.0')
173173
->setDescription('Repo description goes here')
174174
->setShortDescription('Repo short description goes here')
175175
->setURL('https://appwrite.io')

templates/cli/install.ps1.twig

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ ${{ spec.title | upper }}_DOWNLOAD_DIR = Join-Path -Path $env:TEMP -ChildPath "{
2121

2222
# {{ spec.title | caseUcfirst }} CLI location
2323
${{ spec.title | upper }}_INSTALL_DIR = Join-Path -Path $env:LOCALAPPDATA -ChildPath "{{ spec.title | caseUcfirst }}"
24+
${{ spec.title | upper }}_INSTALL_FILE = Join-Path -Path ${{ spec.title | upper }}_INSTALL_DIR -ChildPath "{{ language.params.executableName }}.exe"
2425

2526
$USER_PATH_ENV_VAR = [Environment]::GetEnvironmentVariable("PATH", "User")
2627

@@ -53,8 +54,8 @@ function DownloadBinary {
5354
Invoke-WebRequest -Uri $GITHUB_x64_URL -OutFile ${{ spec.title | upper }}_DOWNLOAD_DIR
5455
}
5556

56-
57-
Move-Item ${{ spec.title | upper }}_DOWNLOAD_DIR ${{ spec.title | upper }}_INSTALL_DIR
57+
New-Item -ItemType Directory -Force -Path ${{ spec.title | upper }}_INSTALL_DIR | Out-Null
58+
Move-Item ${{ spec.title | upper }}_DOWNLOAD_DIR ${{ spec.title | upper }}_INSTALL_FILE
5859
}
5960

6061

@@ -65,6 +66,7 @@ function Install {
6566
Write-Host "Skipping to add {{ spec.title | caseUcfirst }} to User Path."
6667
} else {
6768
[System.Environment]::SetEnvironmentVariable("PATH", $USER_PATH_ENV_VAR + ";${{ spec.title | upper }}_INSTALL_DIR", "User")
69+
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
6870
}
6971
}
7072

0 commit comments

Comments
 (0)