Skip to content

Commit

Permalink
getTez: Make executable with npx
Browse files Browse the repository at this point in the history
  • Loading branch information
harryttd committed Oct 11, 2023
1 parent dba276b commit 777509c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
4 changes: 2 additions & 2 deletions getTez/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ const txHash = await getTez({

### CLI

You can also run the script directly from the command line with Node.js. When you install the package via npm, the JavaScript file will be located at `node_modules/@oxheadalpha/get-tez/dist/getTez.js`. You can run it with the following command:
You can also run `get-tez` directly from the command line with `npx`:

```bash
node node_modules/@oxheadalpha/get-tez tz1... --amount 10 --network ghostnet
npx @oxheadalpha/get-tez tz1... --amount 10 --network ghostnet
```

Run the script with the `--help` flag for more information.
4 changes: 3 additions & 1 deletion getTez/getTez.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env node

import * as crypto from "crypto"

const isMainModule = require.main === module
Expand Down Expand Up @@ -26,7 +28,7 @@ const [time, timeLog, timeEnd] = [
)

const displayHelp = () => {
log(`CLI Usage: node getTez.js [options] <address>
log(`CLI Usage: npx @oxheadalpha/get-tez [options] <address>
Options:
-h, --help Display help information.
-a, --amount <value> The amount of Tez to request.
Expand Down
7 changes: 5 additions & 2 deletions getTez/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion getTez/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{
"name": "@oxheadalpha/get-tez",
"version": "1.0.1",
"version": "1.0.2",
"description": "Programmatic script to get Tezos from faucet",
"main": "dist/getTez.js",
"bin": {
"get-tez": "dist/getTez.js"
},
"types": "dist/getTez.d.ts",
"files": [
"dist",
Expand Down

0 comments on commit 777509c

Please sign in to comment.