Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions sdks/typescript/postinstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,8 @@ function ensureBinaryIsExecutable(binaryPath, platform) {
async function main() {
const binaryPath = getBinaryPath();
if (fs.existsSync(binaryPath)) {
console.log(`${PROJECT_NAME} binary already exists at ${binaryPath}. Skipping download.`);
ensureBinaryIsExecutable(binaryPath, os.platform());
return;
console.log(`${PROJECT_NAME} binary already exists at ${binaryPath}. Removing it for a fresh install.`);
fs.unlinkSync(binaryPath); // This deletes the file
}

if (!fs.existsSync(BIN_DIR)) {
Expand Down
27 changes: 27 additions & 0 deletions sdks/typescript/sample/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Usage samples for `@google/genai/node`

To run the samples first build the SDKs, from the sdks/typescript/:

```sh
# Build the SDK
npm install
npm run build
```

Then `cd sdks/typescript/samples`, install the newly built test-server typescript sdk:

```sh
# install the test-server typescript sdk
cd samples
rm -Rf node_modules # To clean up the old dependencies
npm install
```

Now from sdks/typescript/samples, you can run
```sh
rm -Rf dist # To clean up the old build

npm run test
#or
npm run test:record
```
Loading
Loading