Skip to content
This repository was archived by the owner on Aug 1, 2023. It is now read-only.

Commit 84293f5

Browse files
authored
Use an (untyped) Hack script as the binary (#38)
The README.md specifies that you should run the binary using hhvm. The binary is actually a shell script. This causes the following error: The previous version gave this error and did not execute anything. Fatal error: Uncaught Error: A semicolon (';') is expected here in /path/to/hh-apidoc/bin/hh-apidoc:2 Stack trace: #0 {main} I've cloned this style of binary from hhast.
1 parent 2ccfcea commit 84293f5

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

bin/hh-apidoc

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,22 @@
1-
#!/bin/sh
2-
exec "$(dirname "$0")/hh-apidoc.hack" "$@"
1+
#!/usr/bin/env hhvm
2+
/*
3+
* Copyright (c) 2004-present, Facebook, Inc.
4+
* All rights reserved.
5+
*
6+
* This source code is licensed under the MIT license found in the
7+
* LICENSE file in the root directory of this source tree.
8+
*
9+
*/
10+
11+
namespace Facebook\HHAPIDoc;
12+
13+
// As this file does not have an extension, it is not typechecked. Delegate
14+
// to the typechecked one.
15+
<<__EntryPoint>>
16+
async function cli_main_UNSAFE(): Awaitable<noreturn> {
17+
(() ==> {
18+
// HHAST-generated to avoid pseudomain local leaks
19+
require_once(__DIR__.'/hh-apidoc.hack');
20+
})();
21+
await cli_main();
22+
}

0 commit comments

Comments
 (0)