File tree Expand file tree Collapse file tree
packages/varlock/src/cli/commands Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ import semver from 'semver';
44
55import { type TypedGunshiCommandFn } from '../helpers/gunshi-type-utils' ;
66import { CliExitError } from '../helpers/exit-error' ;
7+ import { isBundledSEA } from '../helpers/install-detection' ;
8+ import { fmt } from '../helpers/pretty-format' ;
79import { downloadPluginToCache } from '../../env-graph/lib/plugins' ;
810
911export const commandSpec = define ( {
@@ -29,6 +31,13 @@ Examples:
2931} ) ;
3032
3133export const commandFn : TypedGunshiCommandFn < typeof commandSpec > = async ( ctx ) => {
34+ if ( ! isBundledSEA ( ) ) {
35+ throw new CliExitError ( 'This command is only available when using the standalone varlock binary' , {
36+ suggestion : 'In a JS project, install plugins as regular dependencies using your package manager.\n'
37+ + `For example: ${ fmt . command ( 'add my-plugin' , { jsPackageManager : true } ) } ` ,
38+ } ) ;
39+ }
40+
3241 const pluginDescriptor = ctx . values . plugin as string | undefined ;
3342
3443 if ( ! pluginDescriptor ) {
You can’t perform that action at this time.
0 commit comments