From 13fdf69f34770f8df1aadfdd62098c4df2716509 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sun, 19 Jan 2025 10:27:10 +0800 Subject: [PATCH] support custom image --- dev-cli/src/commands/build.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/dev-cli/src/commands/build.js b/dev-cli/src/commands/build.js index 01020265d..48da9876c 100644 --- a/dev-cli/src/commands/build.js +++ b/dev-cli/src/commands/build.js @@ -3,8 +3,10 @@ import { Command } from '../deps.js' import { VERSION } from '../versions.js' -export async function build () { +export async function build(customImage) { const pwd = Deno.cwd() + const image = customImage || `p3rmaw3b/ao:${VERSION.IMAGE}` + const p = Deno.run({ cmd: [ 'docker', @@ -13,7 +15,7 @@ export async function build () { 'linux/amd64', '-v', `${pwd}:/src`, - `p3rmaw3b/ao:${VERSION.IMAGE}`, + image, 'ao-build-module' ] }) @@ -22,4 +24,7 @@ export async function build () { export const command = new Command() .description('Build the Lua Project into WASM') - .action(build) + .option('-i, --image ', 'Specify a custom Docker image to use') + .action(async (options) => { + await build(options.image) + })