File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 11#!/usr/bin/env node
2- import '@app/dotenv' ;
32
4- import { execSync } from 'child_process ';
3+ import '@app/dotenv ';
54
5+ import { execa } from 'execa' ;
66import { CommandFactory } from 'nest-commander' ;
77
88import { cliLogger , internalLogger } from '@app/core/log' ;
99import { CliModule } from '@app/unraid-api/cli/cli.module' ;
1010
1111try {
12- const shellToUse = execSync ( 'which unraid-api' ) . toString ( ) . trim ( ) ;
12+ const shellToUse = await execa ( 'which unraid-api' )
13+ . then ( ( res ) => res . toString ( ) . trim ( ) )
14+ . catch ( ( _ ) => '/usr/local/bin/unraid-api' ) ;
1315 await CommandFactory . run ( CliModule , {
1416 cliName : 'unraid-api' ,
1517 logger : false , // new LogService(), - enable this to see nest initialization issues
1618 completion : {
1719 fig : true ,
18- cmd : 'unraid-api ' ,
20+ cmd : 'completion-script ' ,
1921 nativeShell : { executablePath : shellToUse } ,
2022 } ,
2123 } ) ;
You can’t perform that action at this time.
0 commit comments