@inlang/paraglide-js
Version:
[](https://inlang.com)
19 lines (18 loc) • 663 B
JavaScript
import { DEFAULT_OUTDIR } from "../defaults.js";
import { prompt } from "../utils.js";
export const promptForOutdir = async (ctx) => {
const response = await prompt("Where should the compiled files be placed?", {
type: "text",
initial: DEFAULT_OUTDIR,
default: DEFAULT_OUTDIR,
placeholder: "Relative path from the package root to the desired compiler output directory",
});
if (!response.startsWith("./")) {
ctx.logger.warn("You must enter a valid relative path starting from the package root.");
return await promptForOutdir(ctx);
}
return {
...ctx,
outdir: response,
};
};