diff --git a/bin/observable.ts b/bin/observable.ts index 1e119a374..53b98e25f 100755 --- a/bin/observable.ts +++ b/bin/observable.ts @@ -6,6 +6,9 @@ import {readConfig} from "../src/config.js"; const command = process.argv.splice(2, 1)[0]; const CONFIG_OPTION = { + root: { + type: "string" + }, config: { type: "string", short: "c" @@ -20,25 +23,25 @@ switch (command) { } case "build": { const { - values: {config} + values: {config, root} } = helpArgs(command, { options: {...CONFIG_OPTION} }); - await import("../src/build.js").then(async (build) => build.build({config: await readConfig(config)})); + await import("../src/build.js").then(async (build) => build.build({config: await readConfig(config, root)})); break; } case "deploy": { const { - values: {config} + values: {config, root} } = helpArgs(command, { options: {...CONFIG_OPTION} }); - await import("../src/deploy.js").then(async (deploy) => deploy.deploy({config: await readConfig(config)})); + await import("../src/deploy.js").then(async (deploy) => deploy.deploy({config: await readConfig(config, root)})); break; } case "preview": { const { - values: {config, hostname, port} + values: {config, root, hostname, port} } = helpArgs(command, { options: { ...CONFIG_OPTION, @@ -56,7 +59,7 @@ switch (command) { }); await import("../src/preview.js").then(async (preview) => preview.preview({ - config: await readConfig(config), + config: await readConfig(config, root), hostname: hostname!, port: port === undefined ? undefined : +port })