diff --git a/.github/workflows/morphcloud-client-release.yml b/.github/workflows/morphcloud-client-release.yml index 06599c1d..b3f12393 100644 --- a/.github/workflows/morphcloud-client-release.yml +++ b/.github/workflows/morphcloud-client-release.yml @@ -32,7 +32,7 @@ jobs: - name: Validate tag version id: version run: | - TAG_VERSION="${GITHUB_REF#refs/tags/typescript-client-v}" + TAG_VERSION="${GITHUB_REF#refs/tags/morphcloud-client-v}" PACKAGE_VERSION=$(node -p "require('./package.json').version") echo "Tag version: $TAG_VERSION" @@ -47,7 +47,6 @@ jobs: echo "VERSION=$PACKAGE_VERSION" >> $GITHUB_OUTPUT - name: Install dependencies - working-directory: clients/typescript run: npm install - name: Build @@ -59,8 +58,8 @@ jobs: - name: Create GitHub Release uses: softprops/action-gh-release@v2 with: - tag_name: typescript-client-v${{ steps.version.outputs.VERSION }} - name: TypeScript Client v${{ steps.version.outputs.VERSION }} + tag_name: morphcloud-client-v${{ steps.version.outputs.VERSION }} + name: Morph Cloud Client v${{ steps.version.outputs.VERSION }} body: | Published package [@nuanced-dev/lsp-morphcloud](https://www.npmjs.com/package/@nuanced-dev/lsp-morphcloud) to NPM. diff --git a/.github/workflows/typescript-client-release.yml b/.github/workflows/typescript-client-release.yml index 311e9c32..286f7f64 100644 --- a/.github/workflows/typescript-client-release.yml +++ b/.github/workflows/typescript-client-release.yml @@ -47,7 +47,6 @@ jobs: echo "VERSION=$PACKAGE_VERSION" >> $GITHUB_OUTPUT - name: Install dependencies - working-directory: clients/typescript run: npm install - name: Build diff --git a/clients/morphcloud/bin/mutagen/darwin_arm64/mutagen b/clients/morphcloud/bin/mutagen/darwin_arm64/mutagen deleted file mode 100755 index e1816d50..00000000 --- a/clients/morphcloud/bin/mutagen/darwin_arm64/mutagen +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:cab3d665f382edb7fc20fd255d6ebcdb7b964f1b59e29c11b1f6dfdc6bceadfe -size 12863714 diff --git a/clients/morphcloud/bin/mutagen/darwin_arm64/mutagen-agents.tar.gz b/clients/morphcloud/bin/mutagen/darwin_arm64/mutagen-agents.tar.gz deleted file mode 100644 index dfd16b47..00000000 --- a/clients/morphcloud/bin/mutagen/darwin_arm64/mutagen-agents.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:996798a88b94cb7e98e441dbc32d498acb90aa3bcd03d0d0d014ed48de5bcc19 -size 93892428 diff --git a/clients/morphcloud/bin/mutagen/darwin_x64/mutagen b/clients/morphcloud/bin/mutagen/darwin_x64/mutagen deleted file mode 100755 index 735ca86c..00000000 --- a/clients/morphcloud/bin/mutagen/darwin_x64/mutagen +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:251ae38937c4b5e823af0c20be839174db69514f4e9478579317d94e1579861a -size 13681256 diff --git a/clients/morphcloud/bin/mutagen/darwin_x64/mutagen-agents.tar.gz b/clients/morphcloud/bin/mutagen/darwin_x64/mutagen-agents.tar.gz deleted file mode 100644 index dfd16b47..00000000 --- a/clients/morphcloud/bin/mutagen/darwin_x64/mutagen-agents.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:996798a88b94cb7e98e441dbc32d498acb90aa3bcd03d0d0d014ed48de5bcc19 -size 93892428 diff --git a/clients/morphcloud/bin/mutagen/windows_x64/mutagen-agents.tar.gz b/clients/morphcloud/bin/mutagen/windows_x64/mutagen-agents.tar.gz deleted file mode 100644 index dfd16b47..00000000 --- a/clients/morphcloud/bin/mutagen/windows_x64/mutagen-agents.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:996798a88b94cb7e98e441dbc32d498acb90aa3bcd03d0d0d014ed48de5bcc19 -size 93892428 diff --git a/clients/morphcloud/bin/mutagen/windows_x64/mutagen.exe b/clients/morphcloud/bin/mutagen/windows_x64/mutagen.exe deleted file mode 100755 index f7fda5ab..00000000 --- a/clients/morphcloud/bin/mutagen/windows_x64/mutagen.exe +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:fd4a0f57dbedff4580fc467d6b8ae415239ac42afd7fbba15bc113c58fdd6b5b -size 14144000 diff --git a/clients/morphcloud/src/util/mutagen.ts b/clients/morphcloud/src/util/mutagen.ts index be9ea305..482d306f 100644 --- a/clients/morphcloud/src/util/mutagen.ts +++ b/clients/morphcloud/src/util/mutagen.ts @@ -1,6 +1,6 @@ import { join } from "path"; import { platform, arch } from "os"; -import { mkdir } from "fs/promises"; +import { mkdir, access } from "fs/promises"; import { Instance } from "morphcloud"; import { spawn } from "child-process-promise"; import { ensureConfigDirectory } from "./config.js"; @@ -104,7 +104,7 @@ export class MutagenClient { const mutagenDataDir = join(await ensureConfigDirectory(), "mutagen"); await mkdir(mutagenDataDir, { recursive: true }); - const spawnCommand = getMutagenBinaryPath(); + const spawnCommand = await getMutagenBinaryPath(); const spawnArgs = [...args]; const spawnEnv = { ...opts?.env, @@ -120,7 +120,7 @@ export class MutagenClient { } } -function getMutagenBinaryPath(): string { +async function getMutagenBinaryPath(): Promise { const platformArch = `${platform()}_${arch()}`; const binaryName = platform() === "win32" ? "mutagen.exe" : "mutagen"; const binPath = join( @@ -133,5 +133,13 @@ function getMutagenBinaryPath(): string { binaryName, ); + try { + await access(binPath); + } catch { + throw new Error( + `Mutagen not supported for platform ${platform()} and architecture ${arch()}. Missing ${binPath}.`, + ); + } + return binPath; }