Skip to content

Commit

Permalink
build(deps): update oclif to latest version and several other depen…
Browse files Browse the repository at this point in the history
…dencies (#183)
  • Loading branch information
felipecrs committed Apr 25, 2023
1 parent 2906918 commit a9cf7a8
Show file tree
Hide file tree
Showing 13 changed files with 1,780 additions and 3,352 deletions.
9 changes: 4 additions & 5 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": [
"oclif",
"oclif-typescript",
"prettier"
]
"extends": ["oclif", "oclif-typescript", "prettier"],
"rules": {
"unicorn/prefer-module": "off"
}
}
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
persist-credentials: false
- uses: volta-cli/action@v4
- run: npm ci
- run: npm run release
- run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.nyc_output/
lib/
CHANGELOG.md
50 changes: 20 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,48 +10,38 @@ Download and extract binaries from compressed packages.
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

<!-- toc -->
* [bindl](#bindl)
* [Usage](#usage)
<!-- tocstop -->
## Usage

# Usage

<!-- usage -->
```sh-session
$ npm install -g bindl
$ bindl COMMAND
running command...
$ bindl (-v|--version|version)
bindl/4.1.0 linux-x64 node-v18.12.1
$ bindl --help [COMMAND]
USAGE
$ bindl COMMAND
...
```
<!-- usagestop -->
$ npm install --global bindl

```sh-session
$ bindl --help
Downloads and extracts binaries from compressed packages using a config file

USAGE
$ bindl
$ bindl [--version] [--help] [-c <value>]

OPTIONS
-c, --config=config Path to the config file
-h, --help show CLI help
--version show CLI version
FLAGS
-c, --config=<value> Path to the config file
--help Show CLI help.
--version Show CLI version.

DESCRIPTION
The config will be read from any valid config file in the current directory. The configuration file can be
defined using all the extensions and names accepted by cosmiconfig, such as bindl.config.js
Downloads and extracts binaries from compressed packages using a config file
The config will be read from any valid config file in the current directory. The configuration file can be defined using all
the extensions and names accepted by cosmiconfig, such as bindl.config.js
```

You can find an example of config file [here](./test/res/bindl.config.js).
You can find an example of a config file [here](./test/res/bindl.config.js).

## Environment variables

When called without any environment variables, `bindl` downloads all packages from the config file, not matter the platform or architecture.

### `npm_config_arch`

You can also skip the downloads by setting the `BINDL_SKIP` environment variable to a truthy value.
When the `npm_config_arch` is set, `bindl` will only download the packages that match the given architecture for the current architecture. For example, if you set `npm_config_arch=x64` and you are running on Linux, `bindl` will only download the packages that match the `linux` platform and the `x64` architecture, skipping all other packages.

<!-- commands -->
### `BINDL_SKIP`

<!-- commandsstop -->
You can also skip the downloads by setting the `BINDL_SKIP` environment variable to a truthy value, like `BINDL_SKIP=1` or `BINDL_SKIP=true`.
17 changes: 17 additions & 0 deletions bin/dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env node

const oclif = require('@oclif/core')

const path = require('path')
const project = path.join(__dirname, '..', 'tsconfig.json')

// In dev mode -> use ts-node and dev plugins
process.env.NODE_ENV = 'development'

require('ts-node').register({project})

// In dev mode, always show stack traces
oclif.settings.debug = true;

// Start the CLI
oclif.run().then(oclif.flush).catch(oclif.Errors.handle)
3 changes: 3 additions & 0 deletions bin/dev.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off

node "%~dp0\dev" %*
12 changes: 2 additions & 10 deletions bin/run
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
#!/usr/bin/env node

const fs = require('fs')
const path = require('path')
const project = path.join(__dirname, '../tsconfig.json')
const dev = fs.existsSync(project)
const oclif = require('@oclif/core')

if (dev) {
require('ts-node').register({project})
}

require(`../${dev ? 'src' : 'lib'}`).run()
.catch(require('@oclif/errors/handle'))
oclif.run().then(require('@oclif/core/flush')).catch(require('@oclif/core/handle'))

0 comments on commit a9cf7a8

Please sign in to comment.