Back

[SOLVED] How to test the changes of sdk-for-cli in local

  • 0
  • Locale
Fahad Ali
28 May, 2023, 06:26

I was solving an issue of sdk-for-cli repo https://github.com/appwrite/sdk-for-cli. I installed cli after cloning the repo with the commands

TypeScript
  sh install.sh```

the installer downloads its binary from the official file
```downloadBinary() {
    echo "[2/4] Downloading executable for $OS ($ARCH) ..."

    GITHUB_LATEST_VERSION="2.0.2"
    GITHUB_FILE="appwrite-cli-${OS}-${ARCH}"
    GITHUB_URL="https://github.com/$GITHUB_REPOSITORY_NAME/releases/download/$GITHUB_LATEST_VERSION/$GITHUB_FILE"

    printf "${GREEN}🚦 Downloading Appwrite CLI $GITHUB_LATEST_VERSION ... ${NC}\n"
    res=$(curl -s $GITHUB_URL)
    if [[ "$res" == *"Not Found"* ]]; then
        printf "${RED}❌ Couldn't find executable for $OS ($ARCH). Please contact the Appwrite team ${NC} \n"
        exit 1
    fi
    curl -L -o $APPWRITE_TEMP_NAME $GITHUB_URL
    printSuccess
}```

After making changes, how can I test in local?
TL;DR
How to test the changes of sdk-for-cli in local: 1. Clone the sdk-for-cli repo. 2. Run `chmod +x install.sh` and `sh install.sh` to install the production CLI. 3. To test the CLI in the repo, execute the `index.js` file using `node index.js`. 4. Note that the repo is read-only, so any PRs should be made in the sdk generator repo. 5. If you made changes to the repo, you can test them locally by running the updated `index.js` file.
Drake
28 May, 2023, 15:23

Which issue are you working on?

Fahad Ali
28 May, 2023, 15:24
Drake
28 May, 2023, 15:27

sh install.sh installs the production CLI. To test the CLI that's in the repo, you would execute the index.js like node index.js.

Btw, that repo is read-only, so the PR that you make will need to be in the sdk generator repo

Fahad Ali
28 May, 2023, 15:34

Understood, thanks a lot @Steven

Fahad Ali
28 May, 2023, 15:34

issue resolved <:appwriteheart2:1073243188954935387>

Drake
28 May, 2023, 15:35

[SOLVED] How to test the changes of sdk-for-cli in local

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more