Skip to content

Commit

Permalink
fix: add missing files
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Feb 13, 2024
1 parent 994bd0a commit e142331
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/config/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function determineCommandDiscoveryOptions(
if (!commandDiscovery) return

if (typeof commandDiscovery === 'string' && defaultCmdId) {
return {globPatterns: GLOB_PATTERNS, strategy: 'single', target: commandDiscovery}
return {strategy: 'single', target: commandDiscovery}
}

if (typeof commandDiscovery === 'string') {
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export async function run(argv?: string[], options?: Interfaces.LoadOptions): Pr

const config = await Config.load(options ?? require.main?.filename ?? __dirname)

// If this is a single command CLI, then insert the '.' command into the argv array to serve as the command id.
// If this is a single command CLI, then insert the SINGLE_COMMAND_CLI_SYMBOL into the argv array to serve as the command id.
if (config.isSingleCommandCLI) {
argv = [SINGLE_COMMAND_CLI_SYMBOL, ...argv]
}
Expand Down
1 change: 1 addition & 0 deletions src/symbols.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const SINGLE_COMMAND_CLI_SYMBOL = Symbol('#SINGLE_COMMAND_CLI').toString()
10 changes: 10 additions & 0 deletions test/command/fixtures/single-cmd-cli-deprecated/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "single-cmd-cli",
"version": "0.0.0",
"description": "Single Command CLI",
"private": true,
"oclif": {
"default": ".",
"commands": "./dist"
}
}
9 changes: 9 additions & 0 deletions test/command/fixtures/single-cmd-cli-deprecated/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// eslint-disable-next-line node/no-unpublished-import
import {Command} from '../../../../../src/index'

export default class FooBar extends Command {
public static description = 'Description of single command CLI.'
public async run(): Promise<void> {
this.log('hello world!')
}
}
7 changes: 7 additions & 0 deletions test/command/fixtures/single-cmd-cli-deprecated/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"compilerOptions": {
"outDir": "dist",
"rootDirs": ["./src"]
},
"include": ["./src/**/*"]
}

0 comments on commit e142331

Please sign in to comment.