Skip to content

Commit

Permalink
feat: add env var for yarn --network-timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Oct 18, 2023
1 parent ec52b94 commit 699e926
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 20 deletions.
29 changes: 15 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,20 @@ plugins plugin for oclif

<!-- toc -->

- [@oclif/plugin-plugins](#oclifplugin-plugins)
- [What is this?](#what-is-this)
- [Usage](#usage)
- [Friendly names](#friendly-names)
- [Aliases](#aliases)
- [Environment Variables](#environment-variables)
- [Commands](#commands)
<!-- tocstop -->
- [`mycli plugins`](#mycli-plugins)
- [`mycli plugins:inspect PLUGIN...`](#mycli-pluginsinspect-plugin)
- [`mycli plugins:install PLUGIN...`](#mycli-pluginsinstall-plugin)
- [`mycli plugins:link PLUGIN`](#mycli-pluginslink-plugin)
- [`mycli plugins:uninstall PLUGIN...`](#mycli-pluginsuninstall-plugin)
- [`mycli plugins:update`](#mycli-pluginsupdate)
<!-- tocstop -->

# What is this?

Expand Down Expand Up @@ -76,23 +84,16 @@ For removing plugins that are no longer needed (either because they're sunset or

`old-name-plugin` will be autoremoved on the next update and will not be able to be installed with `mycli plugins:install old-name-plugin`.

# Environment Variables

`<CLI>_USE_NETWORK_MUTEX` if true, use the `--mutex=network` option on yarn operations
`<CLI>_NETWORK_MUTEX_PORT` specify the port for the `mutex=network` option, depends on `<CLI>_USE_NETWORK_MUTEX`
`<CLI>_NETWORK_TIMEOUT` specify the `--network-timeout` option on yarn operation (set in milliseconds)

# Commands

<!-- commands -->

- [@oclif/plugin-plugins](#oclifplugin-plugins)
- [What is this?](#what-is-this)
- [Usage](#usage)
- [Friendly names](#friendly-names)
- [Aliases](#aliases)
- [Commands](#commands)
- [`mycli plugins`](#mycli-plugins)
- [`mycli plugins:inspect PLUGIN...`](#mycli-pluginsinspect-plugin)
- [`mycli plugins:install PLUGIN...`](#mycli-pluginsinstall-plugin)
- [`mycli plugins:link PLUGIN`](#mycli-pluginslink-plugin)
- [`mycli plugins:uninstall PLUGIN...`](#mycli-pluginsuninstall-plugin)
- [`mycli plugins:update`](#mycli-pluginsupdate)

## `mycli plugins`

List installed plugins.
Expand Down
12 changes: 6 additions & 6 deletions src/yarn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ export default class Yarn {
: `file:${path.join(cwd, 'yarn.lock')}`
const cacheDir = path.join(this.config.cacheDir, 'yarn')
args = [...args, '--non-interactive', `--mutex=${mutex}`, `--preferred-cache-folder=${cacheDir}`, '--check-files']
if (verbose) {
args.push('--verbose')
}

if (this.config.npmRegistry) {
args.push(`--registry=${this.config.npmRegistry}`)
}
const networkTimeout = this.config.scopedEnvVar('NETWORK_TIMEOUT')
if (networkTimeout) args.push(`--network-timeout=${networkTimeout}`)

if (verbose) args.push('--verbose')

if (this.config.npmRegistry) args.push(`--registry=${this.config.npmRegistry}`)
}

const npmRunPath: typeof NpmRunPath = require('npm-run-path')
Expand Down

0 comments on commit 699e926

Please sign in to comment.