Skip to content

Commit

Permalink
Merge branch 'feature_support_custom_image_when_ao_build' into ryankung
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanKung committed Jan 19, 2025
2 parents a2c110e + 13fdf69 commit 8145e2b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions dev-cli/src/commands/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -13,7 +15,7 @@ export async function build () {
'linux/amd64',
'-v',
`${pwd}:/src`,
`p3rmaw3b/ao:${VERSION.IMAGE}`,
image,
'ao-build-module'
]
})
Expand All @@ -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 <image:string>', 'Specify a custom Docker image to use')
.action(async (options) => {
await build(options.image)
})

0 comments on commit 8145e2b

Please sign in to comment.