Commit daa30c1

Anton Golub <antongolub@antongolub.com>
2025-01-03 18:21:12
fix: add `dotenv` to global types (#1052)
1 parent dfe43fc
Changed files (2)
src/core.ts
@@ -331,8 +331,7 @@ export class ProcessPromise extends Promise<ProcessOutput> {
           if (stdout.length && !stdout[stdout.length - 1]!.toString().endsWith('\n')) c.on.stdout!(EOL, c)
           if (stderr.length && !stderr[stderr.length - 1]!.toString().endsWith('\n')) c.on.stderr!(EOL, c)
 
-          const output = new ProcessOutput(dto)
-          self._output = output
+          const output = self._output = new ProcessOutput(dto)
 
           if (error || status !== 0 && !self.isNothrow()) {
             self._reject(output)
src/globals.ts
@@ -21,18 +21,19 @@ declare global {
   type ProcessOutput = _.ProcessOutput
   var ProcessPromise: typeof _.ProcessPromise
   var ProcessOutput: typeof _.ProcessOutput
-  var log: typeof _.log
   var $: typeof _.$
   var argv: typeof _.argv
   var cd: typeof _.cd
   var chalk: typeof _.chalk
   var defaults: typeof _.defaults
+  var dotenv: typeof _.dotenv
   var echo: typeof _.echo
   var expBackoff: typeof _.expBackoff
   var fs: typeof _.fs
   var glob: typeof _.glob
   var globby: typeof _.globby
   var kill: typeof _.kill
+  var log: typeof _.log
   var minimist: typeof _.minimist
   var nothrow: typeof _.nothrow
   var os: typeof _.os
@@ -42,6 +43,7 @@ declare global {
   var quiet: typeof _.quiet
   var quote: typeof _.quote
   var quotePowerShell: typeof _.quotePowerShell
+  var resolveDefaults: typeof _.resolveDefaults
   var retry: typeof _.retry
   var sleep: typeof _.sleep
   var spinner: typeof _.spinner
@@ -55,6 +57,8 @@ declare global {
   var usePowerShell: typeof _.usePowerShell
   var usePwsh: typeof _.usePwsh
   var useBash: typeof _.useBash
+  var version: typeof _.version
+  var VERSION: typeof _.VERSION
   var which: typeof _.which
   var within: typeof _.within
   var YAML: typeof _.YAML