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
6 changes: 6 additions & 0 deletions src/commands/generate/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { ConfigType, OutConfigType } from "../../utils/shared";

export type GenerateConfigType = {
src?: string;
absolute?: boolean
} & OutConfigType &
ConfigType;

Expand All @@ -17,4 +18,9 @@ export const generateOptions: ProgramOptionsType[] = [
defaultValue: ".",
description: "Relative path where generated files are written",
},
{
name: "absolute",
defaultValue: true,
description: "If the paths used for generating types should be absolute or relative",
},
];
6 changes: 3 additions & 3 deletions src/commands/generate/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import { generateGDScriptPathsFile } from "./generate-script";
import { generateUtils } from "./generate-utils";

export const generateAction = async (passedConfig: GenerateConfigType) => {
const { src, out } = passedConfig;
const { src, out, absolute } = passedConfig;

const resolvedSrc = resolve(src);
const resolvedOut = resolve(out);
const resolvedSrc = absolute ? resolve(src) : src;
const resolvedOut = absolute ? resolve(out) : out;

const gdScriptPaths = await glob(`${resolvedSrc}/**/*.gd`, {
ignore: [`**/.godot/**`],
Expand Down