/
githubmirror
/
gutenberg
Обзор
Документация
Войти
/
githubmirror
/
gutenberg
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
packages/env/bin/wp-env
20 строк
714 B
Christopher Allford
Preferentially Execute Local `wp-env` (#50980)
27 май 2023, 00:10
Не верифицирован
27 май 2023, 00:10
6a16313
Код
Авторство
О чём код?
#!/usr/bin/env node 'use strict'; // Remove 'node' and the name of the script from the arguments. let command = process.argv.slice( 2 ); // Default to help text when they aren't running any commands. if ( ! command.length ) { command = [ '--help' ]; } // Rather than just executing the current CLI we will attempt to find a local version // and execute that one instead. This prevents users from accidentally using the // global CLI when a potentially different local version is expected. const localPath = require.resolve( '@wordpress/env/lib/cli.js', { paths: [ process.cwd(), __dirname ], } ); const cli = require( localPath )(); // Now we can execute the CLI with the given command. cli.parse( command );