mirror of
https://github.com/anomalyco/opencode.git
synced 2026-04-24 06:45:22 +00:00
fix: restore followSymlinks behavior in Glob utility
Add symlink: true to all locations that previously had followSymlinks: true: - theme.tsx: custom themes - config.ts: commands, agents, modes, plugins - skill.ts: external, opencode, and custom skills - registry.ts: custom tools Also fix nodir to default to true (exclude directories) when include is not explicitly set to 'all'.
This commit is contained in:
@@ -409,6 +409,7 @@ async function getCustomThemes() {
|
||||
cwd: dir,
|
||||
absolute: true,
|
||||
dot: true,
|
||||
symlink: true,
|
||||
})) {
|
||||
const name = path.basename(item, ".json")
|
||||
result[name] = await Filesystem.readJson(item)
|
||||
|
||||
@@ -358,6 +358,7 @@ export namespace Config {
|
||||
cwd: dir,
|
||||
absolute: true,
|
||||
dot: true,
|
||||
symlink: true,
|
||||
})) {
|
||||
const md = await ConfigMarkdown.parse(item).catch(async (err) => {
|
||||
const message = ConfigMarkdown.FrontmatterError.isInstance(err)
|
||||
@@ -396,6 +397,7 @@ export namespace Config {
|
||||
cwd: dir,
|
||||
absolute: true,
|
||||
dot: true,
|
||||
symlink: true,
|
||||
})) {
|
||||
const md = await ConfigMarkdown.parse(item).catch(async (err) => {
|
||||
const message = ConfigMarkdown.FrontmatterError.isInstance(err)
|
||||
@@ -433,6 +435,7 @@ export namespace Config {
|
||||
cwd: dir,
|
||||
absolute: true,
|
||||
dot: true,
|
||||
symlink: true,
|
||||
})) {
|
||||
const md = await ConfigMarkdown.parse(item).catch(async (err) => {
|
||||
const message = ConfigMarkdown.FrontmatterError.isInstance(err)
|
||||
@@ -469,6 +472,7 @@ export namespace Config {
|
||||
cwd: dir,
|
||||
absolute: true,
|
||||
dot: true,
|
||||
symlink: true,
|
||||
})) {
|
||||
plugins.push(pathToFileURL(item).href)
|
||||
}
|
||||
|
||||
@@ -93,6 +93,7 @@ export namespace Skill {
|
||||
absolute: true,
|
||||
include: "file",
|
||||
dot: true,
|
||||
symlink: true,
|
||||
})
|
||||
.then((matches) => Promise.all(matches.map(addSkill)))
|
||||
.catch((error) => {
|
||||
@@ -124,6 +125,7 @@ export namespace Skill {
|
||||
cwd: dir,
|
||||
absolute: true,
|
||||
include: "file",
|
||||
symlink: true,
|
||||
})
|
||||
for (const match of matches) {
|
||||
await addSkill(match)
|
||||
@@ -143,6 +145,7 @@ export namespace Skill {
|
||||
cwd: resolved,
|
||||
absolute: true,
|
||||
include: "file",
|
||||
symlink: true,
|
||||
})
|
||||
for (const match of matches) {
|
||||
await addSkill(match)
|
||||
@@ -158,6 +161,7 @@ export namespace Skill {
|
||||
cwd: dir,
|
||||
absolute: true,
|
||||
include: "file",
|
||||
symlink: true,
|
||||
})
|
||||
for (const match of matches) {
|
||||
await addSkill(match)
|
||||
|
||||
@@ -36,7 +36,9 @@ export namespace ToolRegistry {
|
||||
const custom = [] as Tool.Info[]
|
||||
|
||||
const matches = await Config.directories().then((dirs) =>
|
||||
dirs.flatMap((dir) => Glob.scanSync("{tool,tools}/*.{js,ts}", { cwd: dir, absolute: true, dot: true })),
|
||||
dirs.flatMap((dir) =>
|
||||
Glob.scanSync("{tool,tools}/*.{js,ts}", { cwd: dir, absolute: true, dot: true, symlink: true }),
|
||||
),
|
||||
)
|
||||
if (matches.length) await Config.waitForDependencies()
|
||||
for (const match of matches) {
|
||||
|
||||
@@ -16,7 +16,7 @@ export namespace Glob {
|
||||
absolute: options.absolute,
|
||||
dot: options.dot,
|
||||
follow: options.symlink ?? false,
|
||||
nodir: options.include === "file",
|
||||
nodir: options.include !== "all",
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user