bundle/run handles Deno.args better. (denoland/deno_std#514)

Original: 02262c6161
This commit is contained in:
Kitson Kelly 2019-06-22 10:02:53 +10:00 committed by Ryan Dahl
parent 684805919a
commit a02c3bd388
2 changed files with 4 additions and 4 deletions

View file

@ -1,6 +1,6 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import { assertStrictEq, assert } from "../testing/asserts.ts";
import { assert } from "../testing/asserts.ts";
import { exists } from "../fs/exists.ts";
export interface DefineFactory {
@ -98,7 +98,7 @@ export function instantiate(
/** Load the bundle and return the contents asynchronously. */
export async function load(args: string[]): Promise<string> {
// TODO(kitsonk) allow loading of remote bundles via fetch.
assertStrictEq(args.length, 2, "Expected exactly two arguments.");
assert(args.length >= 2, "Expected at least two arguments.");
const [, bundleFileName] = args;
assert(
await exists(bundleFileName),