File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change 11'use strict'
22
3- const { dirname, basename } = require ( 'node:path' )
4-
53const dargs = require ( 'dargs' )
64const $ = require ( 'tinyspawn' )
75
@@ -12,7 +10,9 @@ const args = (flags = {}) => dargs(flags, { useEquals: false }).filter(Boolean)
1210const isJSON = ( str = '' ) => str . startsWith ( '{' )
1311
1412const parse = ( { stdout, stderr, ...details } ) => {
15- if ( details . exitCode === 0 ) { return isJSON ( stdout ) ? JSON . parse ( stdout ) : stdout }
13+ if ( details . exitCode === 0 ) {
14+ return isJSON ( stdout ) ? JSON . parse ( stdout ) : stdout
15+ }
1616 throw Object . assign ( new Error ( stderr ) , { stderr, stdout } , details )
1717}
1818
@@ -26,9 +26,7 @@ const create = binaryPath => {
2626 return fn
2727}
2828
29- const update = ( binaryPath = constants . YOUTUBE_DL_PATH ) => {
30- return $ ( basename ( binaryPath ) , [ '-U' ] , { cwd : dirname ( binaryPath ) } )
31- }
29+ const update = ( binaryPath = constants . YOUTUBE_DL_PATH ) => $ ( binaryPath , [ '-U' ] )
3230
3331const defaultInstance = create ( constants . YOUTUBE_DL_PATH )
3432
You can’t perform that action at this time.
0 commit comments