Skip to content

Commit f87d608

Browse files
committed
feat: move occurances of appwrite in install scripts to params
1 parent ec10de4 commit f87d608

File tree

3 files changed

+33
-33
lines changed

3 files changed

+33
-33
lines changed

templates/cli/README.md.twig

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ You can install the CLI by getting our installation script.
2121

2222
### Linux / MacOS
2323
```bash
24-
$ wget -q https://appwrite.io/cli/install.sh -O - | /bin/bash
24+
$ wget -q https://{{ spec.title | lower }}.io/cli/install.sh -O - | /bin/bash
2525
```
2626

2727
### Windows
2828
```powershell
29-
$ iwr -useb https://appwrite.io/cli/install.ps1 | iex
29+
$ iwr -useb https://{{ spec.title | lower }}.io/cli/install.ps1 | iex
3030
```
3131

3232
## Initialisation
@@ -35,7 +35,7 @@ The CLI needs to be initialised with your project settings. This can be done usi
3535
$ {{ language.params.executableName }} init
3636
```
3737

38-
The CLI requires an endpoint, project ID, API key and a locale to be able to communicate with the Appwrite backend server. There are two ways to achieve this
38+
The CLI requires an endpoint, project ID, API key and a locale to be able to communicate with the {{ spec.title | caseUcfirst }} backend server. There are two ways to achieve this
3939

4040
### 1. Environment file
4141
```sh
@@ -44,9 +44,9 @@ $ {{ language.params.executableName }} --env-file path/to/your/environment/file
4444
The .env file must have the following keys
4545
```sh
4646
endpoint=http://192.168.1.6/v1
47-
X-Appwrite-Project=5ff450422d42f
48-
X-Appwrite-Key=0773c7...a2672a
49-
X-Appwrite-Locale=en-US
47+
X-{{ spec.title | caseUcfirst }}-Project=5ff450422d42f
48+
X-{{ spec.title | caseUcfirst }}-Key=0773c7...a2672a
49+
X-{{ spec.title | caseUcfirst }}-Locale=en-US
5050
```
5151

5252
### 2. Using the prompt
@@ -55,15 +55,15 @@ Invoking `{{ language.params.executableName }} init` without an env file trigger
5555

5656
## Usage
5757

58-
The Appwrite CLI follows the following general syntax.
58+
The {{ spec.title | caseUcfirst }} CLI follows the following general syntax.
5959
```sh
6060
$ {{ language.params.executableName }} [SERVICE] [COMMAND] --[OPTIONS]
6161
```
6262

6363
A few sample commands to get you started
6464

6565
```sh
66-
$ {{ language.params.executableName }} users create --email="hello@appwrite.io" --password="very_strong_password"
66+
$ {{ language.params.executableName }} users create --email="hello@{{ spec.title | lower }}.io" --password="very_strong_password"
6767
$ {{ language.params.executableName }} users list
6868
```
6969

@@ -87,7 +87,7 @@ $ {{ language.params.executableName }} account get --help
8787

8888
## Contribution
8989

90-
This library is auto-generated by Appwrite custom [SDK Generator](https://github.com/appwrite/sdk-generator). To learn more about how you can help us improve this SDK, please check the [contribution guide](https://github.com/appwrite/sdk-generator/blob/master/CONTRIBUTING.md) before sending a pull-request.
90+
This library is auto-generated by {{ spec.title | caseUcfirst }} custom [SDK Generator](https://github.com/{{ spec.title | lower }}/sdk-generator). To learn more about how you can help us improve this SDK, please check the [contribution guide](https://github.com/{{ spec.title | lower }}/sdk-generator/blob/master/CONTRIBUTING.md) before sending a pull-request.
9191

9292
## License
9393

templates/cli/install.ps1.twig

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,25 @@ $version = $this->getParam('version', '');
1010
# Love open-source, dev-tooling and passionate about code as much as we do?
1111
# ---
1212
# We're always looking for awesome hackers like you to join our 100% remote team!
13-
# Check and see if you find any relevant position @ https://appwrite.io/company/careers
13+
# Check and see if you find any relevant position @ https://{{ spec.title | lower }}.io/company/careers
1414
# (and let us know you found this message...)
1515

1616
# This script contains hidden JS code to allow better readability and syntax highlighting
1717
# You can use "View source" of this page to see the full script.
1818

19-
# Appwrite CLI location
20-
$APPWRITE_INSTALL_DIR = Join-Path -Path $env:LOCALAPPDATA -ChildPath "Appwrite"
19+
# {{ spec.title | caseUcfirst }} CLI location
20+
$APPWRITE_INSTALL_DIR = Join-Path -Path $env:LOCALAPPDATA -ChildPath "{{ spec.title | caseUcfirst }}"
2121

22-
# Appwrite CLI Executable name
22+
# {{ spec.title | caseUcfirst }} CLI Executable name
2323
$APPWRITE_EXECUTABLE_NAME = "{{ language.params.executableName }}.ps1"
2424

25-
# Appwrite executable file path
25+
# {{ spec.title | caseUcfirst }} executable file path
2626
$APPWRITE_EXECUTABLE_FILEPATH = Join-Path -Path $APPWRITE_INSTALL_DIR -ChildPath $APPWRITE_EXECUTABLE_NAME
2727

28-
# Appwrite CLI image name
29-
$APPWRITE_CLI_IMAGE_NAME = "appwrite/cli"
28+
# {{ spec.title | caseUcfirst }} CLI image name
29+
$APPWRITE_CLI_IMAGE_NAME = "{{ spec.title | lower }}/cli"
3030

31-
# Appwrite CLI image version
31+
# {{ spec.title | caseUcfirst }} CLI image version
3232
$APPWRITE_CLI_IMAGE_VERSION = "$version"
3333

3434
$APPWRITE_EXECUTABLE_CONTENT = @"
@@ -43,14 +43,14 @@ if ( -not ($allowList -contains $args[0])) {
4343
exit 1
4444
}
4545

46-
docker run -i --rm --volume appwrite-cli:/usr/local/code/app/.preferences/ --volume `$pwd``:/usr/local/code/files:rw $APPWRITE_CLI_IMAGE_NAME`:$APPWRITE_CLI_IMAGE_VERSION (`$args | % {[uri]::EscapeUriString(`$_)})"@
46+
docker run -i --rm --volume {{ spec.title | lower }}-cli:/usr/local/code/app/.preferences/ --volume `$pwd``:/usr/local/code/files:rw $APPWRITE_CLI_IMAGE_NAME`:$APPWRITE_CLI_IMAGE_VERSION (`$args | % {[uri]::EscapeUriString(`$_)})"@
4747

4848
$USER_PATH_ENV_VAR = [Environment]::GetEnvironmentVariable("PATH", "User")
4949

5050
function Greeting {
5151
Write-Host @"{{ language.params.logo | raw }}
5252
"@ -ForegroundColor red
53-
Write-Host "Welcome to the Appwrite CLI install shield."
53+
Write-Host "Welcome to the {{ spec.title | caseUcfirst }} CLI install shield."
5454

5555
}
5656

@@ -88,8 +88,8 @@ function Install {
8888

8989
[void](New-Item -Path $APPWRITE_EXECUTABLE_FILEPATH -Value $APPWRITE_EXECUTABLE_CONTENT -ItemType File -Force)
9090

91-
if ($USER_PATH_ENV_VAR -like '*Appwrite*') {
92-
Write-Host "Skipping to add Appwrite to User Path."
91+
if ($USER_PATH_ENV_VAR -like '*{{ spec.title | caseUcfirst }}*') {
92+
Write-Host "Skipping to add {{ spec.title | caseUcfirst }} to User Path."
9393
}
9494
else {
9595
[System.Environment]::SetEnvironmentVariable("PATH", $USER_PATH_ENV_VAR + ";$APPWRITE_INSTALL_DIR", "User")
@@ -104,7 +104,7 @@ function InstallCompleted {
104104
Write-Host "[4/4] Finishing Installation ... "
105105
cleanup
106106
Write-Host "🤘 May the force be with you."
107-
Write-Host "To get started with Appwrite CLI, please visit https://appwrite.io/docs/command-line"
107+
Write-Host "To get started with {{ spec.title | caseUcfirst }} CLI, please visit https://{{ spec.title | lower }}.io/docs/command-line"
108108
}
109109

110110
Greeting

templates/cli/install.sh.twig

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,25 @@ $version = $this->getParam('version', '');
1111
# Love open-source, dev-tooling and passionate about code as much as we do?
1212
# ---
1313
# We're always looking for awesome hackers like you to join our 100% remote team!
14-
# Check and see if you find any relevant position @ https://appwrite.io/company/careers 👩‍💻 😎
14+
# Check and see if you find any relevant position @ https://{{ spec.title | lower }}.io/company/careers 👩‍💻 😎
1515
# (and let us know you found this message...)
1616

1717
# This script contains hidden JS code to allow better readability and syntax highlighting
1818
# You can use "View source" of this page to see the full script.
1919

20-
# Appwrite CLI location
20+
# {{ spec.title | caseUcfirst }} CLI location
2121
: ${APPWRITE_INSTALL_DIR:="/usr/local/bin"}
2222

23-
# Appwrite CLI Executable name
23+
# {{ spec.title | caseUcfirst }} CLI Executable name
2424
APPWRITE_EXECUTABLE_NAME={{ language.params.executableName }}
2525

26-
# Appwrite executable file path
26+
# {{ spec.title | caseUcfirst }} executable file path
2727
APPWRITE_EXECUTABLE_FILEPATH="${APPWRITE_INSTALL_DIR}/${APPWRITE_EXECUTABLE_NAME}"
2828

29-
# Appwrite CLI image name
30-
APPWRITE_CLI_IMAGE_NAME=appwrite/cli
29+
# {{ spec.title | caseUcfirst }} CLI image name
30+
APPWRITE_CLI_IMAGE_NAME={{ spec.title | lower }}/cli
3131

32-
# Appwrite CLI image version
32+
# {{ spec.title | caseUcfirst }} CLI image version
3333
APPWRITE_CLI_IMAGE_VERSION=$version
3434
# sudo is required to copy executable to APPWRITE_INSTALL_DIR for linux
3535
: ${USE_SUDO:="false"}]
@@ -45,7 +45,7 @@ greeting() {
4545
cat << "EOF"{{ language.params.logo | raw }}
4646
EOF
4747
echo -e "${NC}\n"
48-
echo "🔥 Welcome to the Appwrite CLI install shield 🛡."
48+
echo "🔥 Welcome to the {{ spec.title | caseUcfirst }} CLI install shield 🛡."
4949
}
5050

5151
getSystemInfo() {
@@ -106,7 +106,7 @@ install() {
106106

107107
echo "[3/4] Starting installation ..."
108108

109-
# Fetch the Appwrite CLI Image.
109+
# Fetch the {{ spec.title | caseUcfirst }} CLI Image.
110110
printf "${GREEN}🐳 Pulling docker image ... ${NC}\n"
111111
out=$(docker pull "${APPWRITE_CLI_IMAGE_NAME}:${APPWRITE_CLI_IMAGE_VERSION}")
112112
if [[ $out != *"Image is up to date"* ]] && [[ $out != *"Downloaded newer image"* ]]; then
@@ -140,7 +140,7 @@ for x in "${@}" ; do
140140
_args=$_args" "$x
141141
done
142142

143-
bash -c "docker run -i --rm --volume appwrite-cli:/usr/local/code/app/.preferences/ --volume $(pwd):/usr/local/code/files:rw --network host '$APPWRITE_CLI_IMAGE_NAME:$APPWRITE_CLI_IMAGE_VERSION' $_args" ' > $APPWRITE_EXECUTABLE_NAME
143+
bash -c "docker run -i --rm --volume {{ spec.title | lower }}-cli:/usr/local/code/app/.preferences/ --volume $(pwd):/usr/local/code/files:rw --network host '$APPWRITE_CLI_IMAGE_NAME:$APPWRITE_CLI_IMAGE_VERSION' $_args" ' > $APPWRITE_EXECUTABLE_NAME
144144

145145
printf "${GREEN}🚧 Setting Permissions ${NC}\n"
146146
chmod +x $APPWRITE_EXECUTABLE_NAME
@@ -174,7 +174,7 @@ installCompleted() {
174174
echo "[4/4] Wrapping up installation ... "
175175
cleanup
176176
printf "🤘 May the force be with you. \n"
177-
echo "🚀 To get started with Appwrite CLI, please visit https://appwrite.io/docs/command-line"
177+
echo "🚀 To get started with {{ spec.title | caseUcfirst }} CLI, please visit https://{{ spec.title | lower }}.io/docs/command-line"
178178
}
179179

180180
# Installation Starts here

0 commit comments

Comments
 (0)