From 5093b37c056a7d1a8d3465ae5e203e843cc4b6f7 Mon Sep 17 00:00:00 2001 From: Huu Le <39040748+leehuwuj@users.noreply.github.com> Date: Tue, 25 Jun 2024 15:05:14 +0700 Subject: [PATCH] Add support for Linux (#142) --- .changeset/soft-lies-cry.md | 5 +++++ .github/workflows/e2e.yml | 2 +- create-app.ts | 14 ++++++++++++++ questions.ts | 34 ++++++++++++++++++++-------------- 4 files changed, 40 insertions(+), 15 deletions(-) create mode 100644 .changeset/soft-lies-cry.md diff --git a/.changeset/soft-lies-cry.md b/.changeset/soft-lies-cry.md new file mode 100644 index 00000000..1c5aa5cf --- /dev/null +++ b/.changeset/soft-lies-cry.md @@ -0,0 +1,5 @@ +--- +"create-llama": patch +--- + +Remove non-working file selectors for Linux diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 15df5c8b..7de9ade7 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -17,7 +17,7 @@ jobs: matrix: node-version: [18, 20] python-version: ["3.11"] - os: [macos-latest, windows-latest] + os: [macos-latest, windows-latest, ubuntu-22.04] defaults: run: shell: bash diff --git a/create-app.ts b/create-app.ts index d8c5ae3a..008ab91b 100644 --- a/create-app.ts +++ b/create-app.ts @@ -151,5 +151,19 @@ export async function createApp({ ); } + if ( + dataSources.some((dataSource) => dataSource.type === "file") && + process.platform === "linux" + ) { + console.log( + yellow( + `You can add your own data files to ${terminalLink( + "data", + `file://${root}/data`, + )} folder manually.`, + ), + ); + } + console.log(); } diff --git a/questions.ts b/questions.ts index e2403898..a635f711 100644 --- a/questions.ts +++ b/questions.ts @@ -136,24 +136,30 @@ export const getDataSourceChoices = ( value: "none", }); choices.push({ - title: "Use an example PDF", + title: + process.platform !== "linux" + ? "Use an example PDF" + : "Use an example PDF (you can add your own data files later)", value: "exampleFile", }); } - choices.push( - { - title: `Use local files (${supportedContextFileTypes.join(", ")})`, - value: "file", - }, - { - title: - process.platform === "win32" - ? "Use a local folder" - : "Use local folders", - value: "folder", - }, - ); + // Linux has many distros so we won't support file/folder picker for now + if (process.platform !== "linux") { + choices.push( + { + title: `Use local files (${supportedContextFileTypes.join(", ")})`, + value: "file", + }, + { + title: + process.platform === "win32" + ? "Use a local folder" + : "Use local folders", + value: "folder", + }, + ); + } if (framework === "fastapi") { choices.push({ -- GitLab