Skip to content

Commit

Permalink
Merge pull request #1669 from nellh/deno-cli-bundle
Browse files Browse the repository at this point in the history
Bundle CLI entrypoint with main() call
  • Loading branch information
nellh authored May 4, 2023
2 parents 042d943 + 0e061f5 commit 4248553
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/deno_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ jobs:
- name: Commit to new branch
run: |
mv main/main.js .
git add main.js
mv main/bids-validator.js .
git add main.js bids-validator.js
git commit -m "BLD: $VERSION [skip ci]" || true
- name: Push
run: git push origin deno-build
3 changes: 1 addition & 2 deletions bids-validator/bids-validator-deno
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/bin/env -S deno run --allow-read --allow-write --allow-env --allow-net --allow-run
import { main } from './src/main.ts'
import './src/bids-validator.ts'

await main()
3 changes: 2 additions & 1 deletion bids-validator/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import * as esbuild from 'https://deno.land/x/[email protected]/mod.js'
import { parse } from 'https://deno.land/[email protected]/flags/mod.ts'

const MAIN_ENTRY = 'src/main.ts'
const CLI_ENTRY = 'src/bids-validator.ts'

const httpPlugin = {
name: 'http',
Expand Down Expand Up @@ -43,7 +44,7 @@ const flags = parse(Deno.args, {

const result = await esbuild.build({
format: 'esm',
entryPoints: [MAIN_ENTRY],
entryPoints: [MAIN_ENTRY, CLI_ENTRY],
bundle: true,
outdir: 'dist/validator',
minify: flags.minify,
Expand Down
3 changes: 3 additions & 0 deletions bids-validator/src/bids-validator.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { main } from './main.ts'

await main()

0 comments on commit 4248553

Please sign in to comment.