Skip to content

Commit e5415a2

Browse files
authoredNov 4, 2023
docs: fix deno.land import (#423)
1 parent f9a3014 commit e5415a2

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed
 

‎README.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,10 @@ yarn add openai
1818

1919
You can import in Deno via:
2020

21-
<!-- x-release-please-start-version -->
22-
2321
```ts
24-
import OpenAI from 'https://raw.githubusercontent.com/openai/openai-node/v4.15.0-deno/mod.ts';
22+
import OpenAI from 'https://deno.land/x/openai';
2523
```
2624

27-
<!-- x-release-please-end -->
28-
2925
## Usage
3026

3127
The full API of this library can be found in [api.md file](https://github.com/openai/openai-node/blob/master/api.md). The code below shows how to get started using the chat completions API.

‎scripts/git-publish-deno.sh

+15-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env bash
2+
set -exuo pipefail
23

34
# This script pushes the contents of the `deno`` directory to the `deno` branch,
45
# and creates a `vx.x.x-deno` tag, so that Deno users can
@@ -10,6 +11,7 @@
1011
# - Set the following environment variables when running this script:
1112
# - DENO_PUSH_REMOTE_URL - the remote url of the separate GitHub repo
1213
# - DENO_PUSH_BRANCH - the branch you want to push to in that repo (probably `main`)
14+
# - DENO_MAIN_BRANCH - the branch you want as the main branch in that repo (probably `main`, sometimes `master`)
1315
# - DENO_PUSH_VERSION - defaults to version in package.json
1416
# - DENO_PUSH_RELEASE_TAG - defaults to v$DENO_PUSH_VERSION-deno
1517

@@ -18,8 +20,6 @@ die () {
1820
exit 1
1921
}
2022

21-
set -exuo pipefail
22-
2323
# Allow caller to set the following environment variables, but provide defaults
2424
# if unset
2525
# : "${FOO:=bar}" sets FOO=bar unless it's set and non-empty
@@ -28,8 +28,15 @@ set -exuo pipefail
2828

2929
: "${DENO_PUSH_VERSION:=$(node -p 'require("./package.json").version')}"
3030
: "${DENO_PUSH_BRANCH:=deno}"
31+
: "${DENO_MAIN_BRANCH:=main}"
3132
: "${DENO_PUSH_REMOTE_URL:=$(git remote get-url origin)}"
32-
: "${DENO_PUSH_RELEASE_TAG:="v$DENO_PUSH_VERSION-deno"}"
33+
: "${DENO_GIT_USER_NAME:="Stainless Bot"}"
34+
: "${DENO_GIT_USER_NAME:="bot@stainlessapi.com"}"
35+
if [[ $DENO_PUSH_BRANCH = "deno" ]]; then
36+
: "${DENO_PUSH_RELEASE_TAG:="v$DENO_PUSH_VERSION-deno"}"
37+
else
38+
: "${DENO_PUSH_RELEASE_TAG:="v$DENO_PUSH_VERSION"}"
39+
fi
3340

3441
if [ ! -e deno ]; then ./build; fi
3542

@@ -41,7 +48,7 @@ if [ ! -e deno ]; then ./build; fi
4148

4249
cd deno
4350
rm -rf .git
44-
git init
51+
git init -b "$DENO_MAIN_BRANCH"
4552
git remote add origin "$DENO_PUSH_REMOTE_URL"
4653
if git fetch origin "$DENO_PUSH_RELEASE_TAG"; then
4754
die "Tag $DENO_PUSH_RELEASE_TAG already exists"
@@ -56,6 +63,10 @@ else
5663
# the branch doesn't exist on the remote yet
5764
git checkout -b "$DENO_PUSH_BRANCH"
5865
fi
66+
67+
git config user.email "$DENO_GIT_USER_EMAIL"
68+
git config user.name "$DENO_GIT_USER_NAME"
69+
5970
git add .
6071
git commit -m "chore(deno): release $DENO_PUSH_VERSION"
6172
git tag -a "$DENO_PUSH_RELEASE_TAG" -m "release $DENO_PUSH_VERSION"

0 commit comments

Comments
 (0)
Please sign in to comment.