Skip to content

Commit

Permalink
feat(create-captain-app): better handling of captain.md lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelass committed May 6, 2024
1 parent 532820f commit cd14efd
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 3 deletions.
73 changes: 72 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion packages/create-captain-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,17 @@
"axios": "^1.6.8",
"chalk": "^5.3.0",
"execa": "^8.0.1",
"globby": "^14.0.1",
"gray-matter": "^4.0.3",
"humanize-string": "^3.0.0",
"js-yaml": "^4.1.0",
"js-yaml": "^3.14.1",
"meow": "^13.2.0",
"tar": "^6.2.1",
"uuid": "^9.0.1"
},
"devDependencies": {
"@types/tar": "^6.1.12",
"@types/js-yaml": "^3.12.5",
"@types/uuid": "^9.0.8",
"tsx": "^4.7.2"
},
Expand Down
7 changes: 6 additions & 1 deletion packages/create-captain-app/src/bin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import process from "node:process";
import { VectorStoreDocument } from "@captn/utils/types";
import chalk from "chalk";
import { execa } from "execa";
import { globby } from "globby";
import matter from "gray-matter";
import humanizeString from "humanize-string";
import YAML from "js-yaml";
Expand Down Expand Up @@ -159,7 +160,11 @@ try {
await rm(gitFolder, { recursive: true });
}

const captainMD = path.join(newFolder, "captain.md");
const [captainMD] = await globby([newFolder], {
expandDirectories: {
files: ["captain.md"],
},
});
let captainMDContent = "---\ntype: app\n---\n\n";
try {
captainMDContent = await readFile(captainMD, "utf8");
Expand Down

0 comments on commit cd14efd

Please sign in to comment.