Skip to content
Open
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
45 changes: 29 additions & 16 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@ jobs:

test-cli-wrapper:
name: "Test CLI Wrapper"
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
env:
DEBUG: "*"
steps:
Expand All @@ -135,12 +138,18 @@ jobs:
yarn workspace gel run build
yarn workspace gel pack --filename=${{ github.workspace }}/edgedb-cli.tar.gz

- name: Update Linux kernel for WSL2 (Windows only)
if: runner.os == 'Windows'
run: |
wsl --update

- name: Test CLI wrapper with npm
shell: bash
run: |
mkdir ${{ runner.temp }}/temp-npm
cd ${{ runner.temp }}/temp-npm
mkdir "${{ runner.temp }}/temp-npm"
cd "${{ runner.temp }}/temp-npm"
npm init -y
npm install ${{ github.workspace }}/edgedb-cli.tar.gz
npm install "${{ github.workspace }}/edgedb-cli.tar.gz"
npm exec gel -- project init --non-interactive
npm exec gel -- --version
npm exec gel -- query 'select sys::get_version_as_str()'
Expand All @@ -152,11 +161,12 @@ jobs:
fi

- name: Test CLI wrapper with yarn
shell: bash
run: |
mkdir ${{ runner.temp }}/temp-yarn
cd ${{ runner.temp }}/temp-yarn
mkdir "${{ runner.temp }}/temp-yarn"
cd "${{ runner.temp }}/temp-yarn"
yarn init -y
yarn add ${{ github.workspace}}/edgedb-cli.tar.gz
yarn add "${{ github.workspace}}/edgedb-cli.tar.gz"
yarn gel project init --non-interactive
yarn gel --version
yarn gel query 'select sys::get_version_as_str()'
Expand All @@ -172,13 +182,14 @@ jobs:
version: latest
cache: false
- name: Test CLI wrapper with yarn-berry
shell: bash
run: |
mkdir ${{ runner.temp }}/temp-yarn-berry
cd ${{ runner.temp }}/temp-yarn-berry
mkdir "${{ runner.temp }}/temp-yarn-berry"
cd "${{ runner.temp }}/temp-yarn-berry"
yarn set version berry
yarn init -y
touch yarn.lock
yarn add ${{ github.workspace }}/edgedb-cli.tar.gz
yarn add "${{ github.workspace }}/edgedb-cli.tar.gz"
yarn gel project init --non-interactive
yarn gel --version
yarn gel query 'select sys::get_version_as_str()'
Expand All @@ -194,11 +205,12 @@ jobs:
version: latest
run_install: false
- name: Test CLI wrapper with pnpm
shell: bash
run: |
mkdir ${{ runner.temp }}/temp-pnpm
cd ${{ runner.temp}}/temp-pnpm
mkdir "${{ runner.temp }}/temp-pnpm"
cd "${{ runner.temp}}/temp-pnpm"
pnpm init
pnpm add ${{ github.workspace }}/edgedb-cli.tar.gz
pnpm add "${{ github.workspace }}/edgedb-cli.tar.gz"
pnpm exec gel project init --non-interactive
pnpm exec gel --version
pnpm exec gel query 'select sys::get_version_as_str()'
Expand All @@ -211,11 +223,12 @@ jobs:

- uses: oven-sh/setup-bun@8f24390df009a496891208e5e36b8a1de1f45135
- name: Test CLI wrapper with bun
shell: bash
run: |
mkdir temp-bun
cd temp-bun
mkdir "${{ runner.temp }}/temp-bun"
cd "${{ runner.temp }}/temp-bun"
bun init
bun add ${{ github.workspace }}/edgedb-cli.tar.gz
bun add "${{ github.workspace }}/edgedb-cli.tar.gz"
bun gel project init --non-interactive
bun gel --version
bun gel query 'select sys::get_version_as_str()'
Expand Down
6 changes: 5 additions & 1 deletion packages/gel/src/cli.mts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ const IS_TTY = process.stdout.isTTY;
const SCRIPT_LOCATION = await fs.realpath(fileURLToPath(import.meta.url));
const EDGEDB_PKG_ROOT = "https://packages.edgedb.com";
const CACHE_DIR = envPaths("gel", { suffix: "" }).cache;
const CACHED_CLI_PATH = path.join(CACHE_DIR, "/bin/gel");
const CACHED_CLI_PATH = path.join(
CACHE_DIR,
"bin",
process.platform === "win32" ? "gel.exe" : "gel",
);

const SCRIPT_NAME = import.meta.url.split("/").pop() || "gel";

Expand Down
Loading