Hi!
try passing the URL for this gist to npx
.
#!/usr/bin/env node | |
import { $, require } from 'zx' | |
// const currDate = await $`date` | |
// await console.log(currDate) | |
try { | |
let { version } = await require('./package.json') | |
await console.log(chalk.cyan(version)) | |
const { | |
shell | |
} = await $ | |
const activeShell = await shell | |
await console.log(chalk.green(activeShell)) | |
await console.log(chalk.blue('Hello world!')) | |
await $`exit 1` | |
} | |
catch(err) { | |
console.error(err) | |
console.error(`Exit code: ${err.exitCode}`) | |
console.error(`Error: ${err.stderr}`) | |
process.exit(1) | |
} |
{ | |
"name": "npx-test", | |
"version": "0.0.1", | |
"bin": "./index.mjs", | |
"dependencies": { | |
"zx": "latest", | |
"cowsay": "latest" | |
} | |
} |